Menu test
This commit is contained in:
parent
0f7c9b6e26
commit
ae779c761a
@ -1 +1,4 @@
|
||||
Kommit Kde -N
|
||||
### Your Travel Assistant
|
||||
|
||||
- Je první povnný projekt v rámci Akademie Engeto front-end developer.
|
||||
- Jak prauji na projektu a přidávám nové funkce tak jsem se rozhodl k němu, napsat aspoň pár základních testů v playwright.
|
||||
|
@ -1,14 +1,50 @@
|
||||
import { Locator, Page } from "@playwright/test";
|
||||
export class HomePage {
|
||||
page: Page;
|
||||
aboutUsButtonClick: Locator;
|
||||
whatWeDoButtonClick: Locator;
|
||||
ourTripsButtonClick: Locator;
|
||||
whereToGoButtonClick: Locator;
|
||||
reviewsButtonClick: Locator;
|
||||
|
||||
constructor(page: Page) {
|
||||
this.page = page;
|
||||
this.aboutUsButtonClick = page.locator("#about");
|
||||
this.whatWeDoButtonClick = page.locator("#what-we-do");
|
||||
this.ourTripsButtonClick = page.locator("#trips");
|
||||
this.whereToGoButtonClick = page.locator("#where");
|
||||
this.reviewsButtonClick = page.locator("#reviews");
|
||||
}
|
||||
|
||||
async gotoHome() {
|
||||
await this.page.goto(
|
||||
"https://lukaskanka.cz/YourTravelAssistant/cestovatel.html"
|
||||
);
|
||||
return this;
|
||||
}
|
||||
|
||||
async clickAboutUsButton() {
|
||||
await this.aboutUsButtonClick.click();
|
||||
return this;
|
||||
}
|
||||
|
||||
async clickWhatWeDoButton() {
|
||||
await this.whatWeDoButtonClick.click();
|
||||
return this;
|
||||
}
|
||||
|
||||
async clickOurTripsButton() {
|
||||
await this.ourTripsButtonClick.click();
|
||||
return this;
|
||||
}
|
||||
|
||||
async clickWhereToGoButton() {
|
||||
await this.whereToGoButtonClick.click();
|
||||
return this;
|
||||
}
|
||||
|
||||
async clickReviewButtonClick() {
|
||||
await this.reviewsButtonClick.click();
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
16
tests/menuButton.test.ts
Normal file
16
tests/menuButton.test.ts
Normal file
@ -0,0 +1,16 @@
|
||||
import { test, expect } from "@playwright/test";
|
||||
import { HomePage } from "../page-objects/HomePage";
|
||||
|
||||
// test odsouhlasení cookies
|
||||
test("Menu button test", async ({ page }) => {
|
||||
const homePage = new HomePage(page);
|
||||
await await (
|
||||
await (
|
||||
await (
|
||||
await (
|
||||
await (await homePage.gotoHome()).clickAboutUsButton()
|
||||
).clickWhatWeDoButton()
|
||||
).clickOurTripsButton()
|
||||
).clickWhereToGoButton()
|
||||
).clickReviewButtonClick();
|
||||
});
|
Loading…
Reference in New Issue
Block a user