This file contains hidden or 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
| // list all commit on this file. Also in case of merge or squash it allow to see the commit inside of it | |
| tig path/to/file |
This file contains hidden or 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
| // It is possible using .and locator https://playwright.dev/docs/api/class-locator#locator-and | |
| import { test, expect } from "@playwright/test"; | |
| test(" Text input actions", async ({ page }) => { | |
| await page.goto("https://testautomationpractice.blogspot.com/"); | |
| const textBox = page.getByRole('textbox').and(page.locator("#name")); | |
| await textBox.fill("Playwright"); | |
| await expect(textBox).toHaveValue("Playwright"); | |
| }); |
This file contains hidden or 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
| npx playwright test tests/todo-page.spec.ts |
This file contains hidden or 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
| // https://playwright.dev/docs/api/class-locatorassertions#locator-assertions-to-have-value | |
| const locator = page.locator('input[type=number]'); | |
| await expect(locator).toHaveValue(/[0-9]/); |
This file contains hidden or 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
| // you can do that using the toBeEnabled method of the object that returns expect method | |
| import { test, expect } from '@playwright/test'; | |
| test('basic test', async ({ page }) => { | |
| await page.goto('https://playwright.dev/'); | |
| const inputName = page.locator("#name") // Select element by id | |
| await expect(inputName).toBeEnabled() | |
| }); |
This file contains hidden or 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
| // you can do that using the toBeVisible method of the object that returns expect method | |
| import { test, expect } from '@playwright/test'; | |
| test('basic test', async ({ page }) => { | |
| await page.goto('https://playwright.dev/'); | |
| const inputName = page.locator("#name") // Select element by id | |
| await expect(inputName).toBeVisible() | |
| }); |
This file contains hidden or 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
| // you can do that using the locator method of the page object that is set as argument of the test function argument | |
| import { test, expect } from '@playwright/test'; | |
| test('basic test', async ({ page }) => { | |
| await page.goto('https://playwright.dev/'); | |
| const inputName = page.locator("#name") // Select element by id | |
| await expect(inputName).toBeVisible() | |
| }); |
This file contains hidden or 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
| git remote -v | |
| # origin https://github.com/user/repo.git (fetch) | |
| # origin https://github.com/user/repo.git (push) |
This file contains hidden or 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
| # using pngquant package | |
| https://github.com/kornelski/pngquant |
NewerOlder