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.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.disablePageReloads('Create article through form', async t => { debugger const typeOptions = { paste: true } await t.typeText(page.inputs.title, title, typeOptions) await t.typeText(page.inputs.teaser, teaser, typeOptions) await t.typeText(page.inputs.body, body, typeOptions) await t.typeText(page.inputs.published_at, publishedAt) await t.click(page.form.find('button[type=submit]')) await t.expect(page.title.innerText).eql(`Article #${db.articles.length + 1}`) })
test('Should retrieve main menu snapshot [Labels & Indexes]', async t => { let snapshot = await getMainMenuItem(['Test', 'New Menu']); await t.expect(snapshot.sublabel).eql('item 3'); snapshot = await getMainMenuItem(['Test', { label: 'New Menu', index: 2 }]); await t.expect(snapshot.sublabel).eql('item 4'); });
test('Should retrieve main menu snapshot [Indexes]', async t => { await t.rightClick('body'); const snapshot = await getContextMenuItem([{ index: 2 }]); await t.expect(snapshot.sublabel).eql('item 2'); });
/** * Test submitting the form without data */ test('Test greeting form: empty input', async t => { await t // Click submit button .click(Selector('#root button')) .expect(Selector('#root h1').innerText).eql('you didn\'t tell me who you are.') })
test('Should handle Open Dialog', async t => { await t.click('body'); await setElectronDialogHandler(type => type + ' handled'); await clickOnMainMenuItem(['Test', 'Dialog']); await t.expect(checkDialogHandled()).eql('open-dialog handled'); });
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) })
test('Test greeting form: with name', async t => { await t // Input name .typeText(Selector('#root input[type="text"]'), 'Atreus', { replace: true }) // Click submit button .click(Selector('#root button')) .expect(Selector('#root h1').innerText).eql('hello Atreus!') })
test('Should retrieve main menu snapshot [Labels & Indexes]', async t => { await t.rightClick('body'); let snapshot = await getContextMenuItem(['New Test']); await t.expect(snapshot.sublabel).eql('item 3'); snapshot = await getContextMenuItem([{ label: 'New Test', index: 2 }]); await t.expect(snapshot.sublabel).eql('item 4'); });
// 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 1 task and check it item', async t => { await t .typeText('input', 'task 1') .click('button') .expect(Selector('.alert').innerText).eql('task 1') })