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 |
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" | |
] | |
} |
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 |
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(); | |
}); |
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(); | |
}); |
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 | |
*/ |
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; |
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}']`); | |
}); |
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 ---------*/ | |
// when expect() is in Promise.then() method body | |
// we have to use callback function done() | |
it("test two inputs to have labels with same classes using Promise.then() ", (done) => { | |
getInputsLabelElement(input1).then((label1) => { | |
getInputsLabelElement(input2).then((label2) => { | |
label1.getAttribute("class").then((label1Classes) => { | |
label2.getAttribute("class").then((label2Classes) => { | |
expect(label1Classes).toBe(label2Classes); |
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
# EditorConfig: http://EditorConfig.org | |
# EditorConfig Properties: https://github.com/editorconfig/editorconfig/wiki/EditorConfig-Properties | |
# top-most EditorConfig file | |
root = true | |
### defaults | |
[*] | |
charset = utf-8 |
OlderNewer