Skip to content

Commit

Permalink
Upd dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
And93 committed Aug 24, 2021
1 parent db978f6 commit 0c2e489
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 18 deletions.
26 changes: 15 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ measure page performance using Lighthouse.
| ^4.0.0 | ^5.0.0 | ^5.0.0 | - | ^10 |
| ^5.0.0 | ^5.0.0 | ^5.2.0 | ^6.3.0 | ^10 |
| ^5.2.0 | ^5.0.0 | ^5.5.0 | ^7.0.0 | ^12 |
| ^6.0.0 (`Current`) | ^5.0.0 | ^8.0.0 | ^7.2.0 | ^12.13.0 |
| ^6.0.0 | ^5.0.0 | ^8.0.0 | ^7.2.0 | ^12.13.0 |
| ^7.0.0 (`Current`) | ^5.0.0 | ^10.2.0 | ^8.3.0 | ^12.13.0 |

## How to add this plugin to protractor:

Expand All @@ -38,19 +39,19 @@ plugins: [{
isLandscape?: boolean (Default: false)
},
ignoreHTTPSErrors?: boolean, (Default: false)
slowMo?: number (Default: 0ms)
slowMo?: number, (Default: 0ms)
},
timeout?: number, (Default: 30000ms)
defaultArgs?: {
headless?: boolean,
args?: Array<string>,
userDataDir?: string,
devtools?: boolean
devtools?: boolean,
},
harDir?: './path/to/artifatcs/dir/', (Default: './artifacts/har/')
selenoid?: {
host: string, (E.g.: 'selenoid.example.com' or 'localhost')
port?: number (Default: 4444)
port?: number, (Default: 4444)
},
lighthouse?: {
enabled?: boolean, (Default: false) // This prop allows to connect Lighthouse to Protractor
Expand All @@ -62,8 +63,8 @@ plugins: [{
Default: https://github.com/GoogleChrome/lighthouse/blob/master/lighthouse-core/config/lr-desktop-config.js#L11
reportsDir?: string (Default: './artifacts/lighthouse/')
},
logLevel?: 'verbose' | 'info' | 'warn' | 'error' | 'silent' (Default: 'info') // Changes the plugin logs
}
logLevel?: 'verbose' | 'info' | 'warn' | 'error' | 'silent', (Default: 'info') // Changes the plugin logs
},
}]
```

Expand Down Expand Up @@ -225,11 +226,13 @@ E.g.:
### Example:
#### Javascript
```javascript
// protractor.conf.js
plugins: [{
package: 'protractor-puppeteer-plugin',
configFile: './path/to/puppeteer.conf.json'
configFile: './path/to/puppeteer.conf.json',
}]
// puppeteer.conf.json
Expand Down Expand Up @@ -303,11 +306,13 @@ describe('Example suite', () => {
});
```
#### Typescript
```typescript
// ============== TypeScript ==============
// protractor.conf.ts
import {Config} from 'protractor';
import 'protractor-puppeteer-plugin'; // to have autocomplete
import 'protractor-puppeteer-plugin'; // to have autocomplete OR add 'protractor-puppeteer-plugin' value to types in tsconfig.json https://www.typescriptlang.org/tsconfig#types

export const config: Config = {
// ...
Expand All @@ -319,7 +324,7 @@ export const config: Config = {

// awesome.test.ts
import {browser} from 'protractor';
import 'protractor-puppeteer-plugin'; // to have autocomplete
import 'protractor-puppeteer-plugin'; // to have autocomplete OR add 'protractor-puppeteer-plugin' value to types in tsconfig.json https://www.typescriptlang.org/tsconfig#types

describe('Example suite', () => {
it('Simple test', async () => {
Expand Down Expand Up @@ -388,10 +393,9 @@ describe('Lighthouse workaround', () => {
await browser.get('https://angular.io/');
await browser.$('.button.hero-cta').click();
await browser.lighthouse('https://angular.io/'); // Error: You probably have multiple tabs open to the same origin.
})
});

it('Successful test', async () => {

// await browser.cdp.page.goto('https://angular.io/');
// or
await browser.get('https://angular.io/');
Expand Down
12 changes: 12 additions & 0 deletions RELEASENOTES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# Release notes

## 7.0.0 - 2021-08-24

### Added

* Updated `[email protected]`
> (!) Puppeteer has breaking changes. Release notes:
> [@9.0.0](https://github.com/puppeteer/puppeteer/releases/tag/v9.0.0)
> [@10.0.0](https://github.com/puppeteer/puppeteer/releases/tag/v10.0.0)
* Updated `[email protected]`
> (!) Lighthouse has breaking changes. Release notes:
> [@8.0.0](https://github.com/GoogleChrome/lighthouse/releases/tag/v8.0.0)
## 6.0.0 - 2021-02-27

### Added
Expand Down
9 changes: 4 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "protractor-puppeteer-plugin",
"version": "6.0.0",
"description": "Plugin for merging puppeteer with protractor",
"version": "7.0.0",
"description": "Plugin for using puppeteer with protractor together",
"main": "index.js",
"types": "index.d.ts",
"repository": {
Expand All @@ -16,7 +16,6 @@
"webdriverjs",
"selenium-webdriver",
"chrome devtools protocol",
"chrome",
"cdp",
"har",
"devtools",
Expand All @@ -28,8 +27,8 @@
"homepage": "https://github.com/And93/protractor-puppeteer-plugin#readme",
"dependencies": {
"chrome-har": "^0.11.12",
"lighthouse": "^7.2.0",
"puppeteer-core": "^8.0.0"
"lighthouse": "^8.3.0",
"puppeteer-core": "^10.2.0"
},
"devDependencies": {
"protractor": "^7.0.0"
Expand Down
2 changes: 1 addition & 1 deletion src/helpers/logger.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function Logger(namespace) {
const log = (type, value) => {
const date = new Date();
const time = `${date.getHours()}:${date.getMinutes()}:${date.getSeconds()}:${date.getMilliseconds()}`;
return `[${time}] [PID: ${process.pid}] [${type}] ${namespace} - ${JSON.stringify(value)}`;
return `[${time}] [PID: ${process.pid}] [${type}] ${namespace} - ${JSON.stringify(value, null, 2)}`;
};

return {
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ module.exports = async function () {
const {capabilities, plugins} = await protractor.browser.getProcessedConfig();

if (capabilities.browserName !== 'chrome') {
throw new Error('Supported only Chrome browser.');
throw new Error(`Supported only Chrome browser. Current: ${capabilities.browserName}`);
}

for (const plugin of plugins) {
Expand Down

0 comments on commit 0c2e489

Please sign in to comment.