Skip to content
Snippets Groups Projects
Commit e0241721 authored by Alexandre Ducarne's avatar Alexandre Ducarne
Browse files

Added NPM package

parents
No related branches found
No related tags found
No related merge requests found
module.exports = {
"extends": "google",
"parser": "babel-eslint",
"rules": {
"linebreak-style": 0
}
};
\ No newline at end of file
# AI03 Project : Protractor
## Install Guide
Prerequisites : NodeJS
### Installing Protractor
Clone this repo and run
npm install -g protractor
### Updating Web-driver
webdriver-update
___
### Getting Dev Environment
Run NPM install to get all the necessaries dev packages.
## How to use
Simply run webdriver-manager start to start the server.
Then run the config file with Protractor `protractor protractor.conf.js`
This diff is collapsed.
{
"name": "ai03-protractor",
"version": "1.0.0",
"description": "",
"main": "protractor.conf.js",
"dependencies": {
"@types/jasmine": "^2.8.11",
"protractor-beautiful-reporter": "^1.2.6"
},
"devDependencies": {
"babel-eslint": "^10.0.1",
"eslint": "^5.9.0",
"eslint-config-google": "^0.11.0"
},
"scripts": {
"test": "protractor protractor.conf.js"
},
"repository": {
"type": "git",
"url": "git@gitlab.utc.fr:aducarne/ai03-protractor.git"
},
"keywords": [
"protractor"
],
"author": "Alexandre Ducarne, Boulanger Corentin",
"license": "ISC"
}
let HtmlReporter = require('protractor-beautiful-reporter');
var path = require('path');
exports.config = {
seleniumAddress: 'http://localhost:4444/wd/hub',
// The port to start the selenium server on, or null if the server should
// find its own unused port.
seleniumPort: null,
seleniumArgs: [],
specs: [
'./specs/*.spec.js'
],
capabilities: {
browserName: 'chrome',
chromeOptions: {
args: ["--window-size=1910,1080"]
}
},
// A base URL for your application under test. Calls to protractor.get()
// with relative paths will be prepended with this.
baseUrl: 'http://localhost:9999',
framework: 'jasmine',
onPrepare: function () {
// Add a screenshot reporter:
jasmine.getEnv().addReporter(new HtmlReporter({
preserveDirectory: false,
takeScreenShotsOnlyForFailedSpecs: true,
screenshotsSubfolder: 'images',
jsonsSubfolder: 'jsons',
baseDirectory: 'reports-tmp',
clientDefaults: {
columnSettings: {
displaySessionId:false
}
},
pathBuilder: function pathBuilder(spec, descriptions, results, capabilities) {
// Return '<30-12-2016>/<browser>/<specname>' as path for screenshots:
// Example: '30-12-2016/firefox/list-should work'.
var currentDate = new Date(),
day = currentDate.getDate(),
month = currentDate.getMonth() + 1,
year = currentDate.getFullYear();
var validDescriptions = descriptions.map(function (description) {
return description.replace('/', '@');
});
return path.join(
day + "-" + month + "-" + year,
// capabilities.get('browserName'),
validDescriptions.join('-'));
}
}).getJasmine2Reporter());
},
jasmineNodeOpts: {
// If true, print colors to the terminal.
showColors: true,
// Default time to wait in ms before a test fails.
defaultTimeoutInterval: 30000,
}
};
\ No newline at end of file
describe('Protractor Demo App', function() {
const firstNumber = element(by.model('first'));
const secondNumber = element(by.model('second'));
const goButton = element(by.id('gobutton'));
const latestResult = element(by.binding('latest'));
const history = element.all(by.repeater('result in memory'));
function add(a, b) {
firstNumber.sendKeys(a);
secondNumber.sendKeys(b);
goButton.click();
}
beforeEach(function() {
browser.get('http://juliemr.github.io/protractor-demo/');
});
it('should have a history', function() {
add(1, 2);
add(3, 4);
expect(history.count()).toEqual(2);
add(5, 6);
expect(history.count()).toEqual(0); // This is wrong!
});
it('should like corentin', function() {
expect(true).toBe(true);
});
});
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment