- Run bun i , bun run clean , and do everything we do when we build the app.
- Run bun run start and keep the Metro bundler running through the entire process.
- Run xed ios on the project folder. It will open the Xcode project.
- Set the target device (On the top of the Xcode window, Right after MyBeacon > ) to Any iOS Device (arm64) On the top menu, Press Product > Archive. 5 When the build finishes, Organizer window will come (if not appears go to top menu > windows > organizer). Press Distribute App Select Custom, Next, Select App Store Connect, Next, and select Export , and follow the rest of the wizard
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
| test("Dropdown should be sorted in alphabetical order", async ({ page }) => { | |
| await page.goto(PAGE_URL); | |
| const dropdown = page.getByRole("combobox").and(page.locator("#country")); | |
| const options = await dropdown.locator("option").all(); | |
| const optionValues = await Promise.all(options.map(option => option.textContent())); | |
| const sortedOptionValues = [...optionValues].sort(); | |
| expect(optionValues).toEqual(sortedOptionValues); | |
| }); |
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
| // adding --headed option | |
| npx playwright test tests/singleSelectDropdown.spec.ts --headed |
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
| Selects one or multiple options in the <select> element with locator.selectOption(). You can specify option value, or label to select. Multiple options can be selected. | |
| // Single selection matching the value or label | |
| await page.getByLabel('Choose a color').selectOption('blue'); | |
| // Single selection matching the label | |
| await page.getByLabel('Choose a color').selectOption({ label: 'Blue' }); | |
| // Multiple selected items | |
| await page.getByLabel('Choose multiple colors').selectOption(['red', 'green', 'blue']); |
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() | |
| }); |
NewerOlder