View protractor-config.js
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
export const config = { | |
//... | |
onPrepare: function () { | |
/** | |
* If you are testing against a non-angular site - set ignoreSynchronization setting to true | |
* | |
* If true, Protractor will not attempt to synchronize with the page before | |
* performing actions. This can be harmful because Protractor will not wait | |
* until $timeouts and $http calls have been processed, which can cause | |
* tests to become flaky. This should be used only when necessary, such as |
View protractor-config.js
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
//noinspection JSUnusedGlobalSymbols | |
import {SpecReporter} from "jasmine-spec-reporter"; | |
export const config = { | |
framework: "jasmine2", | |
specs: ["spec/**/*.spec.js"], | |
directConnect: true, | |
chromeDriver: "node_modules/.bin/chromedriver", | |
jasmineNodeOpts: { | |
// remove ugly protractor dot reporter |
View Homepage.spec.js
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
import Homepage from "./pages/Homepage"; | |
const homepage = new Homepage(); | |
describe("homepage", () => { | |
describe("when on homepage", () => { | |
beforeAll(() => { | |
homepage.get(); | |
}); |
View Homepage.spec.js
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
import Homepage from "./pages/Homepage"; | |
const homepage = new Homepage(); | |
describe("homepage", () => { | |
describe("when on homepage", () => { | |
beforeAll(() => { | |
homepage.get(); | |
}); |
View Homepage.js
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
import Page from "../../utils/Page"; | |
import Common from "./Common"; | |
export default class Homepage extends Page { | |
selector = $("#page-main"); | |
get = () => { | |
/** | |
* Browser window will maximize width and height | |
*/ |
View async.js
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
/*-------- Promise.then() syntax ---------*/ | |
/** | |
* @param inputElementWithLabel {ElementFinder} | |
* @returns {Promise.<ElementFinder>} | |
*/ | |
export const getInputsLabelElement = (inputElementWithLabel) => { | |
inputElementWithLabel.getAttribute("id").then((inputId) => { | |
return $(`[for='${inputId}']`); | |
}); |
View .babelrc
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
Show hidden characters
{ | |
"presets": [ | |
"latest", | |
"stage-0" | |
] | |
} |
View .eslintrc.yml
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
--- | |
root: true | |
parser: babel-eslint | |
extends: | |
# http://eslint.org/docs/user-guide/configuring#using-eslintrecommended | |
- eslint:recommended | |
# https://github.com/gajus/eslint-plugin-flowtype | |
- plugin:flowtype/recommended | |
# https://www.npmjs.com/package/eslint-config-airbnb-base |
View addScripts.sh
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
#!/bin/sh | |
packagejson=$(cat package.json) | |
addtopackagejson=$(echo '{ | |
"author": "Marcel Mokoš <https://github.com/marcelmokos>", | |
"pre-commit": [ | |
"lint:pre-commit" | |
], | |
"scripts": { | |
"test": "jest --env=jsdom", | |
"test:coverage": "yarn test -- --coverage", |
View UIElement.js
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
/** | |
* Base ui component class that other components should inherit from. | |
*/ | |
export default class UIComponent { | |
/** | |
* This class property enables use of specific functions 'isDisplayed' and 'waitUntilDisplayed' | |
* @type {ElementFinder} | |
*/ | |
selector = undefined; |
OlderNewer