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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions page_objects_ts/InventoryPage.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { test, expect, Locator, Page } from "@playwright/test";
export class InventoryPage {
page: Page;
userMenu: Locator;
logoutLink: Locator;

constructor(page: Page) {
this.page = page;
this.userMenu = page.locator("#react-burger-menu-btn");
this.logoutLink = page.locator("#logout_sidebar_link");
}

async UserMenuIcon() {
await this.userMenu.click();
}
async Logout() {
await this.logoutLink.click();
}
}

module.exports = { InventoryPage };
File renamed without changes.
2 changes: 1 addition & 1 deletion tests/lockedUser.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { test, expect } from "@playwright/test";
import { MainPage } from "./pages/MainPage";
import { MainPage } from "../page_objects_ts/MainPage";
import usersData from "../fixtures/usersData.json";

test.describe("Tests for locked user", () => {
Expand Down
2 changes: 1 addition & 1 deletion tests/mainPage.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { test, expect } from '@playwright/test';
import { MainPage } from './pages/MainPage';
import { MainPage } from '../page_objects_ts/MainPage';

test.describe("Main Page tests", () => {
test('Visit Main Page', async ({ page }) => {
Expand Down
2 changes: 1 addition & 1 deletion tests/standardUser.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { test, expect } from '@playwright/test';
import { MainPage } from './pages/MainPage';
import { MainPage } from '../page_objects_ts/MainPage';
import usersData from '../fixtures/usersData.json';

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