-
Notifications
You must be signed in to change notification settings - Fork 113
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* upgrade playwright * fix lint * integrate test report * add selector id * implement page-object-model & add more test
- Loading branch information
Showing
10 changed files
with
69 additions
and
24 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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,17 @@ | ||
import {test, expect} from "@playwright/test"; | ||
import {HomePage} from "./pages/home.page.js"; | ||
|
||
test.describe("Cari Kerja Home Page E2E Test", () => { | ||
test.beforeEach(async ({page}) => { | ||
const homePage = new HomePage(page); | ||
await homePage.open(); | ||
expect(await page.textContent("h4")).toBe( | ||
"Kata siapa cari software engineer yang berpengalaman itu susah?", | ||
); | ||
}); | ||
|
||
test("user should be able to filter using location", async ({page}) => { | ||
const homePage = new HomePage(page); | ||
await homePage.filterByLocation("bandung"); | ||
}); | ||
}); |
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,29 @@ | ||
import {expect} from "@playwright/test"; | ||
|
||
export class HomePage { | ||
/** | ||
* @param { import('@playwright/test').Page} page | ||
*/ | ||
|
||
constructor(page) { | ||
this.page = page; | ||
this.inputLocation = page.locator("#inputLocation"); | ||
this.listLocation = page.locator("#listLocation"); | ||
} | ||
|
||
async open() { | ||
await this.page.goto("/"); | ||
} | ||
|
||
/** | ||
* @param {string} location | ||
*/ | ||
async filterByLocation(location) { | ||
await this.inputLocation.click(); | ||
await this.inputLocation.fill(location); | ||
await this.page.keyboard.press("Enter"); | ||
for (const li of await this.listLocation.all()) { | ||
expect(li).toContainText(location, {ignoreCase: true}); | ||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.