const iframeAmount = await Selector('#leader-iframes iframe').count; console.log('LeaderElection(' + methodType + ') still no success (' + iframeAmount + ' iframes left)');
test('create first shopping list', async t => { await t.typeText(Selector('input[type=text]').nth(0), 'First Shopping List') await t.click(Selector('button').withText('Add Shopping List')) await t.expect(await Selector('td > a').count).eql(1) })
/** * Get the amount of swag items on the page * * @returns {Promise<number>} */ getAmount() { return this.cartItems.count; }
test('should list be empty', async (t) => { await registerFirstUser(t) await refreshAndWait(t, () => Selector('.shopping-list').count, 1) })
test('Gradually delete tasks and check it item', async t => { const page = new TodosPage(); await page.fillForm(t) await t .click(Selector('.alert').nth(0)) .expect(Selector('.alert').count).eql(2) .expect(Selector('.alert').nth(0).innerText).eql('task 2') .expect(Selector('.alert').nth(1).innerText).eql('task 3') .click(Selector('.alert').nth(1)) .expect(Selector('.alert').nth(0).innerText).eql('task 2') .click(Selector('.alert').nth(0)) .expect(Selector('.alert').count).eql(0) })
test.disablePageReloads('Browse items inside listing', async t => { debugger const itemsCount = db.articles.length await t.expect(await page.fields.id.count).eql(itemsCount) await t.expect(await page.fields.title.count).eql(itemsCount) await t.expect(await page.fields.published_at.count).eql(itemsCount) })
test('create second shopping list', async (t) => { await loginFirstUser(t) await waitSelector(t, 'ShoppingLists', Selector('.example-form-control')) await t.typeText( await Selector('.example-form-control'), 'Second Shopping List' ) await t.click(await Selector('button').withText('Add Shopping List')) await refreshAndWait(t, () => Selector('.shopping-list').count, 3) })
/** * Get the amount of swag items on the page * * @returns {Promise<number>} */ getAmount() { return this.swagItems.count; }
test('remove shopping lists', async t => { await t.click(Selector('.btn.btn-default')) await t.click(Selector('.btn.btn-default')) await t.expect(await Selector('td > a').count).eql(0) })
test('remove items in second shopping list', async t => { await t.click(Selector('a').withText('Second Shopping List')) await t.wait(3000) await t.click(Selector('.example-close-button')) await t.click(Selector('.example-close-button')) await t.click(Selector('.example-close-button')) await t.expect(await Selector('td > a').count).eql(0) })
/** * Get the amount of swag items listed on the page * * @returns {Promise<number>} */ getSwagAmount() { return this.items.count; }
test('create first shopping list', async (t) => { await loginFirstUser(t) await waitSelector(t, 'ShoppingLists', Selector('.example-form-control')) await t.typeText( await Selector('.example-form-control'), 'First Shopping List' ) await t.click(await Selector('button').withText('Add Shopping List')) await refreshAndWait(t, () => Selector('.shopping-list').count, 2) })
test('create second shopping list', async t => { await t.typeText(Selector('input[type=text]').nth(0), 'Second Shopping List') await t.click(Selector('button').withText('Add Shopping List')) await t.expect(await Selector('td > a').count).eql(2) })
test('remove items in first shopping list', async t => { await t.click(Selector('a').withText('First Shopping List')) await t.wait(3000) await t.click(Selector('.example-close-button')) await t.click(Selector('.example-close-button')) await t.click(Selector('.example-close-button')) await t.expect(await Selector('td > a').count).eql(0) })