-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f8fbfe2
commit 79e00e4
Showing
16 changed files
with
338 additions
and
535 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
/* | ||
Copyright (c) Microsoft Corporation. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
export function exampleText() { | ||
return `const { chromium, devices } = require('.'); | ||
(async () => { | ||
const browser = await chromium.launch({ | ||
headless: false | ||
}); | ||
const context = await browser.newContext({ | ||
// ...devices['iPhone 11'] | ||
}); | ||
// Open new page | ||
const page = await context.newPage(); | ||
// Go to https://github.com/microsoft | ||
await page.goto('https://github.com/microsoft'); | ||
await page._pause(); | ||
// Click input[aria-label="Find a repository…"] | ||
await page.click('input[aria-label="Find a repository…"]'); | ||
// Fill input[aria-label="Find a repository…"] | ||
await Promise.all([ | ||
page.waitForNavigation(/*{ url: 'https://github.com/microsoft?q=playwright&type=&language=' }*/), | ||
page.fill('input[aria-label="Find a repository…"]', 'playwright') | ||
]); | ||
// Click //a[normalize-space(.)='playwright'] | ||
await page.click('//a[normalize-space(.)=\'playwright\']'); | ||
// assert.equal(page.url(), 'https://github.com/microsoft/playwright'); | ||
// Click text="Issues" | ||
await Promise.all([ | ||
page.waitForNavigation(/*{ url: 'https://github.com/microsoft/playwright/issues' }*/), | ||
page.click('text="Issues"') | ||
]); | ||
// Click text="triaging" | ||
await Promise.all([ | ||
page.waitForNavigation(/*{ url: 'https://github.com/microsoft/playwright/issues?q=is:issue+is:open+label:triaging' }*/), | ||
page.click('text="triaging"') | ||
]); | ||
// Click text=/.*\[BUG\]\[Electron\] page\.waitForSe.*/ | ||
await Promise.all([ | ||
page.waitForNavigation(/*{ url: 'https://github.com/microsoft/playwright/issues/4961' }*/), | ||
page.click('text=/.*\\\[BUG\\\]\\\[Electron\\\] page\.waitForSe.*/') | ||
]); | ||
await page._pause(); | ||
// Click div[id="partial-users-participants"] img[alt="@pavelfeldman"] | ||
await page.click('div[id="partial-users-participants"] img[alt="@pavelfeldman"]'); | ||
// assert.equal(page.url(), 'https://github.com/pavelfeldman'); | ||
await page._pause(); | ||
// Click text=/.*Repositories.*/ | ||
await Promise.all([ | ||
page.waitForNavigation(/*{ url: 'https://github.com/pavelfeldman?tab=repositories' }*/), | ||
page.click('text=/.*Repositories.*/') | ||
]); | ||
await page._pause(); | ||
// Click text=/.*playwright.*/ | ||
await page.click('text=/.*playwright.*/'); | ||
// assert.equal(page.url(), 'https://github.com/pavelfeldman/playwright'); | ||
await page._pause(); | ||
// --------------------- | ||
await context.close(); | ||
await browser.close(); | ||
})();`; | ||
} |
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
Oops, something went wrong.