Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.
TypeScript automationchromechromiume2e-testingelectronend-to-end-testingfirefoxjavascriptplaywrighttesttest-automationtestingtesting-toolswebwebkit
devops: make README.md to always reflect tip-of-tree (#1911)
Andrey Lushnikov89007c8f3d5c
diff --git a/README.md b/README.mdindex 502b859ef6..ea965bc941 100644--- a/README.md+++ b/README.md@@ -1,16 +1,16 @@# 🎭 Playwright-[](https://www.npmjs.com/package/playwright) <!-- GEN:chromium-version-badge-if-release -->[](https://www.chromium.org/Home)<!-- GEN:stop --> <!-- GEN:firefox-version-badge-if-release -->[](https://www.mozilla.org/en-US/firefox/new/)<!-- GEN:stop --> [](https://webkit.org/) [](https://join.slack.com/t/playwright/shared_invite/enQtOTEyMTUxMzgxMjIwLThjMDUxZmIyNTRiMTJjNjIyMzdmZDA3MTQxZWUwZTFjZjQwNGYxZGM5MzRmNzZlMWI5ZWUyOTkzMjE5Njg1NDg)+[](https://www.npmjs.com/package/playwright) <!-- GEN:chromium-version-badge -->[](https://www.chromium.org/Home)<!-- GEN:stop --> <!-- GEN:firefox-version-badge -->[](https://www.mozilla.org/en-US/firefox/new/)<!-- GEN:stop --> [](https://webkit.org/) [](https://join.slack.com/t/playwright/shared_invite/enQtOTEyMTUxMzgxMjIwLThjMDUxZmIyNTRiMTJjNjIyMzdmZDA3MTQxZWUwZTFjZjQwNGYxZGM5MzRmNzZlMWI5ZWUyOTkzMjE5Njg1NDg)-###### [API](https://github.com/microsoft/playwright/blob/v0.13.0/docs/api.md) | [Changelog](https://github.com/microsoft/playwright/releases) | [FAQ](#faq) | [Contributing](#contributing)+###### [API](https://github.com/microsoft/playwright/blob/master/docs/api.md) | [Changelog](https://github.com/microsoft/playwright/releases) | [FAQ](#faq) | [Contributing](#contributing)Playwright is a Node library to automate the [Chromium](https://www.chromium.org/Home), [WebKit](https://webkit.org/) and [Firefox](https://www.mozilla.org/en-US/firefox/new/) browsers with a single API. It enables **cross-browser** web automation that is **ever-green**, **capable**, **reliable** and **fast**.| | ver | Linux | macOS | Win || ---: | :---: | :---: | :---: | :---: |-| Chromium| <!-- GEN:chromium-version-if-release-->83.0.4101.0<!-- GEN:stop --> | :white_check_mark: | :white_check_mark: | :white_check_mark: |+| Chromium| <!-- GEN:chromium-version GEN:stop --> | :white_check_mark: | :white_check_mark: | :white_check_mark: || WebKit | 13.0.4 | :white_check_mark: | :white_check_mark: | :white_check_mark: |-| Firefox | <!-- GEN:firefox-version-if-release -->75.0b8<!-- GEN:stop --> | :white_check_mark: | :white_check_mark: | :white_check_mark: |+| Firefox | <!-- GEN:firefox-version -->76.0b5<!-- GEN:stop --> | :white_check_mark: | :white_check_mark: | :white_check_mark: |- Headless is supported for all the browsers on all platforms.diff --git a/docs/api.md b/docs/api.mdindex cb9e0905b0..98cebebb45 100644--- a/docs/api.md+++ b/docs/api.md@@ -1,6 +1,5 @@# Playwright API <!-- GEN:version -->Tip-Of-Tree<!-- GEN:stop-->-<!-- GEN:empty-if-release --><!-- GEN:stop -->##### Table of Contentsdiff --git a/utils/doclint/cli.js b/utils/doclint/cli.jsindex f24a7b6460..21a665a516 100755--- a/utils/doclint/cli.js+++ b/utils/doclint/cli.js@@ -54,7 +54,6 @@ async function run() {chromiumVersion: browserVersions.chromium,firefoxVersion: browserVersions.firefox,})));- messages.push(...await preprocessor.ensureReleasedAPILinks([readme], VERSION));messages.push(...preprocessor.ensureInternalLinksAreValid([api]));const browser = await playwright.chromium.launch();diff --git a/utils/doclint/preprocessor/index.js b/utils/doclint/preprocessor/index.jsindex a491b55076..f5622754a3 100644--- a/utils/doclint/preprocessor/index.js+++ b/utils/doclint/preprocessor/index.js@@ -16,21 +16,6 @@const Message = require('../Message');-function ensureReleasedAPILinks(sources, libversion) {- // Release version is everything that doesn't include "-".- const apiLinkRegex = /https:\/\/github.com\/microsoft\/playwright\/blob\/v[^/]*\/docs\/api.md/ig;- const lastReleasedAPI = `https://github.com/microsoft/playwright/blob/v${libversion.split('-')[0]}/docs/api.md`;-- const messages = [];- for (const source of sources) {- const text = source.text();- const newText = text.replace(apiLinkRegex, lastReleasedAPI);- if (source.setText(newText))- messages.push(Message.warning(`GEN: updated ${source.projectPath()}`));- }- return messages;-};-function runCommands(sources, {libversion, chromiumVersion, firefoxVersion}) {// Release version is everything that doesn't include "-".const isReleaseVersion = !libversion.includes('-');@@ -66,16 +51,14 @@ function runCommands(sources, {libversion, chromiumVersion, firefoxVersion}) {let newText = null;if (command.name === 'version')newText = isReleaseVersion ? 'v' + libversion : 'Tip-Of-Tree';- else if (command.name === 'empty-if-release')- newText = isReleaseVersion ? '' : command.originalText;- else if (command.name === 'chromium-version-if-release')- newText = isReleaseVersion ? chromiumVersion : command.originalText;- else if (command.name === 'firefox-version-if-release')- newText = isReleaseVersion ? firefoxVersion : command.originalText;- else if (command.name === 'chromium-version-badge-if-release')- newText = isReleaseVersion ? `[](https://www.chromium.org/Home)` : command.originalText;- else if (command.name === 'firefox-version-badge-if-release')- newText = isReleaseVersion ? `[](https://www.mozilla.org/en-US/firefox/new/)` : command.originalText;+ else if (command.name === 'chromium-version')+ newText = chromiumVersion;+ else if (command.name === 'firefox-version')+ newText = firefoxVersion;+ else if (command.name === 'chromium-version-badge')+ newText = `[](https://www.chromium.org/Home)`;+ else if (command.name === 'firefox-version-badge')+ newText = `[](https://www.mozilla.org/en-US/firefox/new/)`;else if (command.name === 'toc')newText = generateTableOfContents(command.source.text(), command.to, false /* topLevelOnly */);else if (command.name === 'toc-top-level')@@ -194,4 +177,4 @@ function generateTableOfContentsForSuperclass(text, name) {return text;}-module.exports = {ensureInternalLinksAreValid, runCommands, ensureReleasedAPILinks};\ No newline at end of file+module.exports = {ensureInternalLinksAreValid, runCommands};diff --git a/utils/doclint/preprocessor/test.js b/utils/doclint/preprocessor/test.jsindex 031b9a3e51..a658979fd3 100644--- a/utils/doclint/preprocessor/test.js+++ b/utils/doclint/preprocessor/test.js@@ -14,7 +14,7 @@* limitations under the License.*/-const {runCommands, ensureReleasedAPILinks} = require('.');+const {runCommands, ensureTipOfTreeAPILinks} = require('.');const Source = require('../Source');const TestRunner = require('../../testrunner/');const runner = new TestRunner();@@ -24,43 +24,6 @@ const {it, fit, xit} = runner.api();const {beforeAll, beforeEach, afterAll, afterEach} = runner.api();const {expect} = runner.api();-describe('ensureReleasedAPILinks', function() {- it('should work with non-release version', function() {- const source = new Source('doc.md', `- [API](https://github.com/microsoft/playwright/blob/v1.1.0/docs/api.md#class-page)- `);- const messages = ensureReleasedAPILinks([source], '1.3.0-post');- expect(messages.length).toBe(1);- expect(messages[0].type).toBe('warning');- expect(messages[0].text).toContain('doc.md');- expect(source.text()).toBe(`- [API](https://github.com/microsoft/playwright/blob/v1.3.0/docs/api.md#class-page)- `);- });- it('should work with release version', function() {- const source = new Source('doc.md', `- [API](https://github.com/microsoft/playwright/blob/v1.1.0/docs/api.md#class-page)- `);- const messages = ensureReleasedAPILinks([source], '1.3.0');- expect(messages.length).toBe(1);- expect(messages[0].type).toBe('warning');- expect(messages[0].text).toContain('doc.md');- expect(source.text()).toBe(`- [API](https://github.com/microsoft/playwright/blob/v1.3.0/docs/api.md#class-page)- `);- });- it('should keep master links intact', function() {- const source = new Source('doc.md', `- [API](https://github.com/microsoft/playwright/blob/master/docs/api.md#class-page)- `);- const messages = ensureReleasedAPILinks([source], '1.3.0');- expect(messages.length).toBe(0);- expect(source.text()).toBe(`- [API](https://github.com/microsoft/playwright/blob/master/docs/api.md#class-page)- `);- });-});-describe('runCommands', function() {const OPTIONS_REL = {libversion: '1.3.0',@@ -95,7 +58,7 @@ describe('runCommands', function() {Playwright <!-- gen:version -->v1.3.0<!-- gen:stop -->`);});- it('should work for *-post versions', function() {+ it('should work for pre-release versions', function() {const source = new Source('doc.md', `Playwright <!-- gen:version -->XXX<!-- gen:stop -->`);@@ -122,30 +85,6 @@ describe('runCommands', function() {expect(messages[0].text).toContain(`Failed to find 'gen:stop'`);});});- describe('gen:empty-if-release', function() {- it('should clear text when release version', function() {- const source = new Source('doc.md', `- <!-- gen:empty-if-release -->XXX<!-- gen:stop -->- `);- const messages = runCommands([source], OPTIONS_REL);- expect(messages.length).toBe(1);- expect(messages[0].type).toBe('warning');- expect(messages[0].text).toContain('doc.md');- expect(source.text()).toBe(`- <!-- gen:empty-if-release --><!-- gen:stop -->- `);- });- it('should keep text when non-release version', function() {- const source = new Source('doc.md', `- <!-- gen:empty-if-release -->XXX<!-- gen:stop -->- `);- const messages = runCommands([source], OPTIONS_DEV);- expect(messages.length).toBe(0);- expect(source.text()).toBe(`- <!-- gen:empty-if-release -->XXX<!-- gen:stop -->- `);- });- });describe('gen:toc', function() {it('should work', () => {const source = new Source('doc.md', `<!-- gen:toc -->XXX<!-- gen:stop -->@@ -231,7 +170,6 @@ describe('runCommands', function() {it('should work with multiple commands', function() {const source = new Source('doc.md', `<!-- gen:version -->xxx<!-- gen:stop -->- <!-- gen:empty-if-release -->yyy<!-- gen:stop --><!-- gen:version -->zzz<!-- gen:stop -->`);const messages = runCommands([source], OPTIONS_REL);@@ -240,55 +178,34 @@ describe('runCommands', function() {expect(messages[0].text).toContain('doc.md');expect(source.text()).toBe(`<!-- gen:version -->v1.3.0<!-- gen:stop -->- <!-- gen:empty-if-release --><!-- gen:stop --><!-- gen:version -->v1.3.0<!-- gen:stop -->`);});- describe('gen:chromium-version-if-release', function() {- it('should work for release', function() {+ describe('gen:chromium-version', function() {+ it('should work', function() {const source = new Source('doc.md', `- Playwright <!-- gen:chromium-version-if-release -->XXX<!-- gen:stop -->+ Playwright <!-- gen:chromium-version -->XXX<!-- gen:stop -->`);const messages = runCommands([source], OPTIONS_REL);expect(messages.length).toBe(1);expect(messages[0].type).toBe('warning');expect(messages[0].text).toContain('doc.md');expect(source.text()).toBe(`- Playwright <!-- gen:chromium-version-if-release -->80.0.4004.0<!-- gen:stop -->- `);- });- it('should be noop for dev', function() {- const source = new Source('doc.md', `- Playwright <!-- gen:chromium-version-if-release -->XXX<!-- gen:stop -->- `);- const messages = runCommands([source], OPTIONS_DEV);- expect(messages.length).toBe(0);- expect(source.text()).toBe(`- Playwright <!-- gen:chromium-version-if-release -->XXX<!-- gen:stop -->+ Playwright <!-- gen:chromium-version -->80.0.4004.0<!-- gen:stop -->`);});});describe('gen:firefox-version', function() {- it('should work for release', function() {+ it('should work', function() {const source = new Source('doc.md', `- Playwright <!-- gen:firefox-version-if-release -->XXX<!-- gen:stop -->+ Playwright <!-- gen:firefox-version -->XXX<!-- gen:stop -->`);const messages = runCommands([source], OPTIONS_REL);expect(messages.length).toBe(1);expect(messages[0].type).toBe('warning');expect(messages[0].text).toContain('doc.md');expect(source.text()).toBe(`- Playwright <!-- gen:firefox-version-if-release -->73.0b3<!-- gen:stop -->- `);- });- it('should be noop for dev', function() {- const source = new Source('doc.md', `- Playwright <!-- gen:firefox-version-if-release -->XXX<!-- gen:stop -->- `);- const messages = runCommands([source], OPTIONS_DEV);- expect(messages.length).toBe(0);- expect(source.text()).toBe(`- Playwright <!-- gen:firefox-version-if-release -->XXX<!-- gen:stop -->+ Playwright <!-- gen:firefox-version -->73.0b3<!-- gen:stop -->`);});});