mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00
docs(readme): fix API link to always point to last released API
This commit is contained in:
parent
f114255a3d
commit
0f1a42a5d3
@ -1,7 +1,7 @@
|
|||||||
# Playwright
|
# Playwright
|
||||||
[](https://www.npmjs.com/package/playwright) [](https://www.chromium.org/Home) [](https://www.mozilla.org/en-US/firefox/new/) [](https://webkit.org/) [](https://join.slack.com/t/playwright/shared_invite/enQtOTEyMTUxMzgxMjIwLThjMDUxZmIyNTRiMTJjNjIyMzdmZDA3MTQxZWUwZTFjZjQwNGYxZGM5MzRmNzZlMWI5ZWUyOTkzMjE5Njg1NDg)
|
[](https://www.npmjs.com/package/playwright) [](https://www.chromium.org/Home) [](https://www.mozilla.org/en-US/firefox/new/) [](https://webkit.org/) [](https://join.slack.com/t/playwright/shared_invite/enQtOTEyMTUxMzgxMjIwLThjMDUxZmIyNTRiMTJjNjIyMzdmZDA3MTQxZWUwZTFjZjQwNGYxZGM5MzRmNzZlMWI5ZWUyOTkzMjE5Njg1NDg)
|
||||||
|
|
||||||
###### [API v0.10.0](https://github.com/microsoft/playwright/blob/master/docs/api-0.10.0.md) | [API latest](https://github.com/microsoft/playwright/blob/master/docs/api.md) | [FAQ](#faq) | [Contributing](#contributing)
|
###### [API](https://github.com/microsoft/playwright/blob/v0.10.0/docs/api.md) | [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**.
|
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**.
|
||||||
|
|||||||
3879
docs/api-0.10.0.md
3879
docs/api-0.10.0.md
File diff suppressed because it is too large
Load Diff
@ -18,8 +18,8 @@ const Message = require('../Message');
|
|||||||
|
|
||||||
module.exports.ensureReleasedAPILinks = function(sources, version) {
|
module.exports.ensureReleasedAPILinks = function(sources, version) {
|
||||||
// Release version is everything that doesn't include "-".
|
// Release version is everything that doesn't include "-".
|
||||||
const apiLinkRegex = /https:\/\/github.com\/Microsoft\/playwright\/blob\/v[^/]*\/docs\/api.md/ig;
|
const apiLinkRegex = /https:\/\/github.com\/microsoft\/playwright\/blob\/v[^/]*\/docs\/api.md/ig;
|
||||||
const lastReleasedAPI = `https://github.com/Microsoft/playwright/blob/v${version.split('-')[0]}/docs/api.md`;
|
const lastReleasedAPI = `https://github.com/microsoft/playwright/blob/v${version.split('-')[0]}/docs/api.md`;
|
||||||
|
|
||||||
const messages = [];
|
const messages = [];
|
||||||
for (const source of sources) {
|
for (const source of sources) {
|
||||||
|
|||||||
@ -28,36 +28,36 @@ const {expect} = new Matchers();
|
|||||||
describe('ensureReleasedAPILinks', function() {
|
describe('ensureReleasedAPILinks', function() {
|
||||||
it('should work with non-release version', function() {
|
it('should work with non-release version', function() {
|
||||||
const source = new Source('doc.md', `
|
const source = new Source('doc.md', `
|
||||||
[API](https://github.com/Microsoft/playwright/blob/v1.1.0/docs/api.md#class-page)
|
[API](https://github.com/microsoft/playwright/blob/v1.1.0/docs/api.md#class-page)
|
||||||
`);
|
`);
|
||||||
const messages = ensureReleasedAPILinks([source], '1.3.0-post');
|
const messages = ensureReleasedAPILinks([source], '1.3.0-post');
|
||||||
expect(messages.length).toBe(1);
|
expect(messages.length).toBe(1);
|
||||||
expect(messages[0].type).toBe('warning');
|
expect(messages[0].type).toBe('warning');
|
||||||
expect(messages[0].text).toContain('doc.md');
|
expect(messages[0].text).toContain('doc.md');
|
||||||
expect(source.text()).toBe(`
|
expect(source.text()).toBe(`
|
||||||
[API](https://github.com/Microsoft/playwright/blob/v1.3.0/docs/api.md#class-page)
|
[API](https://github.com/microsoft/playwright/blob/v1.3.0/docs/api.md#class-page)
|
||||||
`);
|
`);
|
||||||
});
|
});
|
||||||
it('should work with release version', function() {
|
it('should work with release version', function() {
|
||||||
const source = new Source('doc.md', `
|
const source = new Source('doc.md', `
|
||||||
[API](https://github.com/Microsoft/playwright/blob/v1.1.0/docs/api.md#class-page)
|
[API](https://github.com/microsoft/playwright/blob/v1.1.0/docs/api.md#class-page)
|
||||||
`);
|
`);
|
||||||
const messages = ensureReleasedAPILinks([source], '1.3.0');
|
const messages = ensureReleasedAPILinks([source], '1.3.0');
|
||||||
expect(messages.length).toBe(1);
|
expect(messages.length).toBe(1);
|
||||||
expect(messages[0].type).toBe('warning');
|
expect(messages[0].type).toBe('warning');
|
||||||
expect(messages[0].text).toContain('doc.md');
|
expect(messages[0].text).toContain('doc.md');
|
||||||
expect(source.text()).toBe(`
|
expect(source.text()).toBe(`
|
||||||
[API](https://github.com/Microsoft/playwright/blob/v1.3.0/docs/api.md#class-page)
|
[API](https://github.com/microsoft/playwright/blob/v1.3.0/docs/api.md#class-page)
|
||||||
`);
|
`);
|
||||||
});
|
});
|
||||||
it('should keep master links intact', function() {
|
it('should keep master links intact', function() {
|
||||||
const source = new Source('doc.md', `
|
const source = new Source('doc.md', `
|
||||||
[API](https://github.com/Microsoft/playwright/blob/master/docs/api.md#class-page)
|
[API](https://github.com/microsoft/playwright/blob/master/docs/api.md#class-page)
|
||||||
`);
|
`);
|
||||||
const messages = ensureReleasedAPILinks([source], '1.3.0');
|
const messages = ensureReleasedAPILinks([source], '1.3.0');
|
||||||
expect(messages.length).toBe(0);
|
expect(messages.length).toBe(0);
|
||||||
expect(source.text()).toBe(`
|
expect(source.text()).toBe(`
|
||||||
[API](https://github.com/Microsoft/playwright/blob/master/docs/api.md#class-page)
|
[API](https://github.com/microsoft/playwright/blob/master/docs/api.md#class-page)
|
||||||
`);
|
`);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user