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

Merge branch 'feature/CI' into 'develop'

Website is now ENT UTC

See merge request !6
parents 611c7522 bb7cea86
No related branches found
No related tags found
2 merge requests!7v1.0,!6Website is now ENT UTC
...@@ -24,14 +24,14 @@ exports.config = { ...@@ -24,14 +24,14 @@ exports.config = {
// A base URL for your application under test. Calls to protractor.get() // A base URL for your application under test. Calls to protractor.get()
// with relative paths will be prepended with this. // with relative paths will be prepended with this.
baseUrl: 'http://localhost:9999', baseUrl: 'https://webapplis.utc.fr/ent/',
directConnect: true, directConnect: true,
framework: 'jasmine', framework: 'jasmine',
onPrepare: function() { onPrepare: function() {
jasmine.getEnv().addReporter(new SpecReporter({spec: {displayStacktrace: true}})); jasmine.getEnv().addReporter(new SpecReporter({spec: {displayStacktrace: true}}));
// Add a screenshot reporter: // Add a screenshot reporter:
jasmine.getEnv().addReporter(new HtmlReporter({ jasmine.getEnv().addReporter(new HtmlReporter({
preserveDirectory: true, preserveDirectory: true,
...@@ -49,19 +49,18 @@ exports.config = { ...@@ -49,19 +49,18 @@ exports.config = {
const day = currentDate.getDate(); const day = currentDate.getDate();
const month = currentDate.getMonth() + 1; const month = currentDate.getMonth() + 1;
const year = currentDate.getFullYear(); const year = currentDate.getFullYear();
const time = currentDate.getHours() + ':' + currentDate.getMinutes() + '-' + currentDate.getSeconds(); const time = currentDate.getHours() + '-' + currentDate.getMinutes();
const validDescriptions = descriptions.map(function(description) { const validDescriptions = descriptions.map(function(description) {
return description.replace('/', '@'); return description.replace('/', '@');
}); });
return path.join( return path.join(
day + '-' + month + '-' + year +'-'+ time, year + '-' + month + '-' + day + '-' + time,
validDescriptions.join('-')); validDescriptions.join('-'));
}, },
}).getJasmine2Reporter()); }).getJasmine2Reporter());
}, },
jasmineNodeOpts: { jasmineNodeOpts: {
showColors: true, showColors: true,
defaultTimeoutInterval: 30000, defaultTimeoutInterval: 30000,
......
describe('Protractor Demo App', function() { describe('Protractor Demo App', function() {
const firstNumber = element(by.model('first')); beforeAll(function() {
const secondNumber = element(by.model('second')); browser.ignoreSynchronization = true;
const goButton = element(by.id('gobutton')); browser.get('index.jsf');
// const latestResult = element(by.binding('latest'));
const history = element.all(by.repeater('result in memory'));
/**
*
* @param {*} a
* @param {*} b
*/
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() { it('should enter aducarne', function() {
add(1, 2); let username = element(by.id('username')).sendKeys('aducarne');
add(3, 4); expect(username.getAttribute('value')).toBe('aducarne');
expect(history.count()).toEqual(2);
add(5, 6);
expect(history.count()).toEqual(3); // This is wrong!
}); });
it('should like corentin', function() { it('should enter aducarne', function() {
expect(true).toBe(true); let pass = element(by.id('password')).sendKeys('password');
expect(pass.getAttribute('value')).toBe('password');
browser.sleep(2000);
}); });
}); });
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