test('should allow users to login and see their documents', async (browser) => { await login({ email: 'user+1@test.com', password: 'password', browser, }); await browser.expect(getPageUrl()).contains('/documents'); });
test('Take screenshot', async t => { var screenshotName = getTempFileName({ template: 'screenshot-XXXXXX.png' }); var screenshotPath = path.join('.screenshots', screenshotName); await t.takeScreenshot(screenshotName); await t.expect(statSync(screenshotPath).isFile()).ok(); });
test('Should click on main menu [Selector]', async t => { await t.click('body'); await clickOnMainMenuItem(['Test', 'Click']); await t.expect(checkMainMenuClicked()).ok(); });
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('should validate that we can continue shopping', async t => { await setTestContext({ baseUrl: LoginPage.url, user: LOGIN_USERS.STANDARD, path: PAGES.CHECKOUT_COMPLETE, }); await t.expect(CheckoutCompletePage.isScreenDisplayed()).ok(); });
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('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('Should click on main menu [Snapshot]', async t => { await t.rightClick('body'); const snapshot = await getContextMenuItem(['Test']); await clickOnContextMenuItem(snapshot); await t.expect(checkContextMenuClicked()).ok(); });
test('Should click on main menu [Snapshot]', async t => { await t.click('body'); const snapshot = await getMainMenuItem(['Test', 'Click']); await clickOnMainMenuItem(snapshot); await t.expect(checkMainMenuClicked()).ok(); });
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'); });