WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit a625025

Browse files
authored
Merge pull request #15 from auto-qa-hub/po_for_logout
test-for-logout-po
2 parents 8a99a82 + 094e1a3 commit a625025

File tree

5 files changed

+24
-3
lines changed

5 files changed

+24
-3
lines changed

page_objects_ts/InventoryPage.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { test, expect, Locator, Page } from "@playwright/test";
2+
export class InventoryPage {
3+
page: Page;
4+
userMenu: Locator;
5+
logoutLink: Locator;
6+
7+
constructor(page: Page) {
8+
this.page = page;
9+
this.userMenu = page.locator("#react-burger-menu-btn");
10+
this.logoutLink = page.locator("#logout_sidebar_link");
11+
}
12+
13+
async UserMenuIcon() {
14+
await this.userMenu.click();
15+
}
16+
async Logout() {
17+
await this.logoutLink.click();
18+
}
19+
}
20+
21+
module.exports = { InventoryPage };

tests/lockedUser.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { test, expect } from "@playwright/test";
2-
import { MainPage } from "./pages/MainPage";
2+
import { MainPage } from "../page_objects_ts/MainPage";
33
import usersData from "../fixtures/usersData.json";
44

55
test.describe("Tests for locked user", () => {

tests/mainPage.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { test, expect } from '@playwright/test';
2-
import { MainPage } from './pages/MainPage';
2+
import { MainPage } from '../page_objects_ts/MainPage';
33

44
test.describe("Main Page tests", () => {
55
test('Visit Main Page', async ({ page }) => {

tests/standardUser.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { test, expect } from '@playwright/test';
2-
import { MainPage } from './pages/MainPage';
2+
import { MainPage } from '../page_objects_ts/MainPage';
33
import usersData from '../fixtures/usersData.json';
44

55
test.describe("Standard user tests", () => {

0 commit comments

Comments
 (0)