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'); });
fixture`Test checkout summary page` .beforeEach(async t => { await t.resizeWindow(1366, 768); await setTestContext({ baseUrl: LoginPage.url, user: LOGIN_USERS.STANDARD, path: PAGES.CART, products: [PRODUCTS.BACKPACK], }); await t.expect(CartSummaryPage.isScreenDisplayed()).ok(); await MenuPage.open(); });
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('should validate that we can go from the cart to the checkout page', async t => { await setTestContext({ baseUrl: LoginPage.url, user: LOGIN_USERS.STANDARD, path: PAGES.CART, }); await t.expect(CartSummaryPage.isScreenDisplayed()).ok(); await CartSummaryPage.goToCheckout(); await t.expect(CheckoutPersonalInfoPage.isScreenDisplayed()).ok(); });
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('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('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 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 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 validate that all products are present', async t => { await setTestContext({ baseUrl: LoginPage.url, user: LOGIN_USERS.STANDARD, path: PAGES.SWAG_ITEMS, }); // The actual test await t.expect(SwagOverviewPage.getAmount()).eql(6); });
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'); });