Skip to content

Commit

Permalink
fix case
Browse files Browse the repository at this point in the history
  • Loading branch information
pythongiant committed Dec 31, 2019
1 parent c370a8b commit b301209
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions test/ui-2/test/DropDownButtonStep.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
const timeout = process.env.SLOWMO ? 30000 : 10000;
const fs = require('fs');
beforeAll(async () => {
path = fs.realpathSync('file://../examples/index.html');
await page.goto('file://' + path, {waitUntil: 'domcontentloaded'});
});
describe('Add step dropdown', ()=>{
test('Click Button', async()=>{
// Wait for .step to load
await page.waitForSelector('.step');
/// Get Length Of steps
const Length = await page.evaluate(() => document.querySelectorAll('.step').length);

// Wait for .selectize-input to load
await page.waitForSelector('.selectize-input');
// Click dropdown and select appropriate option. then submit
await page.click('.selectize-input');
await page.click('[data-value=\'blend\']');
await page.waitForSelector('#add-step-btn');
await page.click('#add-step-btn');

// Get Changed Length
const LengthChanged = await page.evaluate(() => document.querySelectorAll('.step').length);

// Check If Image Of Step actually Changed
await page.waitForSelector('.step img');
const src1 = await page.evaluate(() => document.querySelectorAll('.step img')[0].src);
const src2 = await page.evaluate(() => document.querySelectorAll('.step img')[1].src);
expect(src1).not.toEqual(src2);

expect(Length).toBe(1);
expect(LengthChanged).toBe(2);

}, timeout);
});

0 comments on commit b301209

Please sign in to comment.