-
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.
complete e2e test, lookup more validations and element-list itereations
- Loading branch information
1 parent
27896f9
commit db8e122
Showing
3 changed files
with
41 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
const {test, expect} = require("@playwright/test"); | ||
|
||
test('Calendars validations', async ({page})=> | ||
{ | ||
const monthNumber = "5"; | ||
const date = "14"; | ||
const year = "2027"; | ||
const expectedDate = [monthNumber, date, year]; | ||
|
||
await page.goto("https://rahulshettyacademy.com/seleniumPractise/#/offers"); | ||
await page.locator(".react-date-picker__inputGroup").click(); | ||
await page.locator(".react-calendar__navigation__label").click(); | ||
await page.locator(".react-calendar__navigation__label").click(); //second click to select year within calendar thingy | ||
await page.getByText(year).click(); | ||
await page.locator(".react-calendar__year-view__months__month").nth(Number(monthNumber)-1).click(); //select all cells, can pass to click on nth() one | ||
await page.locator("//abbr[text()='"+date+"']").click(); //pass the date within the locator | ||
|
||
const inputs = await page.locator(".react-date-picker__inputGroup input"); | ||
for (let index = 0; index < inputs.length; index++) //go through all 3 datepicker elements | ||
{ | ||
const value = inputs[index].getAttribute("value"); | ||
expect(value).toEqual(expectedDate[index]); | ||
} | ||
}) | ||
|
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,14 @@ | ||
const { test, expect } = require("@playwright/test"); | ||
|
||
test("Popup validations", async({page})=> | ||
{ | ||
await page.goto("https://rahulshettyacademy.com/AutomationPractice") | ||
// await page.goBack(); | ||
// await page.goForward(); | ||
|
||
await expect(page.locator("#displayed-text")).toBeVisible(); | ||
await page.locator("#hide-textbox").click(); | ||
await expect(page.locator("#displayed-text")).toBeHidden(); | ||
|
||
|
||
}) |