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
| describe('protractor react selector tests', () => { | |
| beforeAll(async function () { | |
| await browser.waitForAngularEnabled(false) | |
| await browser.get('https://ahfarmer.github.io/calculator/') | |
| await browser.waitForReact() | |
| }) | |
| it('This should test react selector with component, props and react root element', async () => { | |
| // state is empty for the element | |
| const _element = element(by.react('t', { name: '5' }, {}, '#root')) |
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
| beforeAll(() => { | |
| await browser.get('http://localhost:3000/myApp') | |
| await browser.waitForReact() | |
| }) |
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
| // imports | |
| const MyComponent = ({ someBooleanProp }) => ( | |
| <div>My Component {someBooleanProp ? 'show this' : ''} </div> | |
| ); | |
| const App = () => ( | |
| <div> | |
| <MyComponent /> | |
| <MyComponent someBooleanProp={true} /> | |
| </div> | |
| ); |
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
| // first option: TAG your scenario uniquely and use the tag to execute a particular scenario | |
| npx protractor protractor.conf.js --cucumberOpts.tags="@tag1" | |
| // second option: Use the name of the scenario | |
| npx protractor protractor.conf.js --cucumberOpts.name="my scenario name" |
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
| // Specify a feature file | |
| $ cucumber-js features/my_feature.feature | |
| // Specify a scenario by its line number | |
| $ cucumber-js features/my_feature.feature:3 | |
| // Specify a scenario by its name matching a regular expression | |
| $ cucumber-js --name "topic 1" |
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
| import "jasmine"; | |
| import { browser } from "protractor"; | |
| import { lrHelper } from "./lighthouse/lighthouse.helper"; | |
| describe("Open Angular Docs and run a lighthouse scan", () => { | |
| beforeEach(async () => { | |
| await browser.waitForAngularEnabled(false); | |
| await browser.get("https://angular.io/"); | |
| }); |
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
| import lighthouse = require("lighthouse"); | |
| import ReportGenerator = require("lighthouse/lighthouse-core/report/report-generator"); | |
| import * as lightExpect from "./lighthouse.expectation.json"; | |
| import * as fs from "fs"; | |
| export class LightHouseHelper { | |
| // method to run lighthouse audit | |
| lighthouseAudit = async url => { | |
| console.log("target url:", url); | |
| const opts = { |
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
| import { Config } from "protractor"; | |
| export let config: Config = { | |
| specs: ["./specs/test.js"], | |
| framework: "jasmine", | |
| capabilities: { | |
| browserName: "chrome", | |
| chromeOptions: { | |
| useAutomationExtension: false, |
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
| { | |
| "name": "protractor-lighthouse", | |
| "version": "1.0.0", | |
| "description": "Demo project to shocase Protractor integration with lighthouse", | |
| "main": "index.js", | |
| "dependencies": { | |
| "@types/jasmine": "^2.8.6", | |
| "@types/node": "^9.4.6", | |
| "jasmine": "^3.1.0", | |
| "lighthouse": "5.5.0", |
NewerOlder