await AsyncTestUtil.waitUntil(async () => { await assertNoErrors(t); const stateContainer = Selector('#state'); const exists = await stateContainer.exists; if (!exists) {
test.disablePageReloads('Article can not be saved without title', async t => { debugger await t.selectText(page.inputs.title.find('input'), 0).pressKey('delete') await t.click(page.form.find('button[type=submit]')) await t.expect(Selector('#title-helper-text').innerText).eql('Title is required') })
test('create items in first shopping list', async t => { await t.click(Selector('a').withText('First Shopping List')) await t.wait(3000) await t.typeText(Selector('input[type=text]').nth(1), 'Item 1') await t.click(Selector('button').withText('Add Item')) await t.typeText(Selector('input[type=text]').nth(1), 'Item 2') await t.click(Selector('button').withText('Add Item')) await t.typeText(Selector('input[type=text]').nth(1), 'Item 3') await t.click(Selector('button').withText('Add Item')) await t.expect(Selector('label').withText('Item 1').exists).eql(true) await t.expect(Selector('label').withText('Item 2').exists).eql(true) await t.expect(Selector('label').withText('Item 3').exists).eql(true) })
test('remove items in first shopping list', async (t) => { await loginFirstUser(t) await waitSelector( t, 'ShoppingLists', Selector('a').withText('First Shopping List') ) await t.click(Selector('a').withText('First Shopping List')) await waitSelector(t, 'ShoppingLists', Selector('.example-close-button')) await t.click(Selector('.example-close-button')) await t.click(Selector('.example-close-button')) await t.click(Selector('.example-close-button')) await t.expect(Selector('.shopping-list').count).eql(0) })
test('should back to home if back button clicked', async t => { await t .click('[data-tid="backButton"] > a') .expect(Selector('[data-tid="container"]').visible) .ok(); });
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) })
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) })
// specify the start page //then create a test and place your code there test('My first test', async t => { await t .typeText('div.FPdoLc.VlcLAe > center > input:nth-of-type(1)', 'Aditya Inapurapu') .pressKey('enter') // Use the assertion to check if the actual header text is equal to the expected one .expect(Selector('#rso > div:first-child > div.srg > div:first-child > div > div.rc > h3.r > a').innerText).eql('Aditya Inapurapu - Senior Automation / Release Engineer - Blue ...'); });
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) })