-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from JakubRumpca/Test-case-06
Test case 06: Sort by name
- Loading branch information
Showing
3 changed files
with
58 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { test, expect } from '@playwright/test'; | ||
import { LoginPage } from '../page_object/loginPage'; | ||
import { HomePage } from '../page_object/homePage' | ||
|
||
test('Should sort the products by name in descending and ascending order', async ({ page }) => { | ||
const loginPage = new LoginPage(page); | ||
const homePage = new HomePage(page); | ||
await loginPage.login(process.env.STANDARD_USER, process.env.PASSWORD); | ||
await homePage.sortByName("desc"); | ||
expect(await homePage.checkFirstItemOnProductList()).toContainText("T-Shirt (Red)"); | ||
await homePage.sortByName("asc"); | ||
expect(await homePage.checkFirstItemOnProductList()).toContainText("Sauce Labs Backpack"); | ||
}); |