Skip to content
Snippets Groups Projects
Commit 2c31b6af authored by Alex ORLUC's avatar Alex ORLUC
Browse files

test e2e

parent 4316b0f4
No related branches found
No related tags found
No related merge requests found
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
"upgrade": "ncu -u", "upgrade": "ncu -u",
"create-component": "echo Component name ? && read varname && ng g c $varname --module app", "create-component": "echo Component name ? && read varname && ng g c $varname --module app",
"create-component-admin": "echo Component name ? && read varname && ng g c administration/$varname --module administration", "create-component-admin": "echo Component name ? && read varname && ng g c administration/$varname --module administration",
"ee-launch": "webdriver-manager update --versions.chrome=80.0.3987.162 && webdriver-manager start --detach --versions.chrome=80.0.3987.162 && protractor test/e2e/conf.js && webdriver-manager shutdown && fuser -k 4444/tcp", "ee-launch": "webdriver-manager update --versions.chrome=80.0.3987.162 && webdriver-manager start --detach --versions.chrome=80.0.3987.162 && protractor test/e2e/conf.js && webdriver-manager shutdown && fuser -k 4444/tcp && base64 exception.png",
"ee-update": "webdriver-manager update", "ee-update": "webdriver-manager update",
"ee-start-server": "webdriver-manager start", "ee-start-server": "webdriver-manager start",
"ee-test": "protractor test/e2e/conf.js" "ee-test": "protractor test/e2e/conf.js"
......
var fs = require('fs');
// abstract writing screen shot to a file
function writeScreenShot(data, filename) {
var stream = fs.createWriteStream(filename);
stream.write(new Buffer(data, 'base64'));
stream.end();
}
describe('index resource page', function() { describe('index resource page', function() {
it('login to app', function() { it('login to app', function() {
browser.waitForAngularEnabled(true); browser.waitForAngularEnabled(true);
browser.get(browser.baseUrl+ '/dist/index.html#/login'); browser.get(browser.baseUrl+ '/dist/index.html#/login');
browser.takeScreenshot().then(function (png) {
writeScreenShot(png, 'exception.png');
});
element(by.id('login')).sendKeys('bblier'); element(by.id('login')).sendKeys('bblier');
browser.sleep(500); browser.sleep(500);
element(by.id('password')).sendKeys('maarch'); element(by.id('password')).sendKeys('maarch');
...@@ -12,8 +23,14 @@ describe('index resource page', function() { ...@@ -12,8 +23,14 @@ describe('index resource page', function() {
it('index a document whitout file', function() { it('index a document whitout file', function() {
browser.sleep(4000); browser.sleep(4000);
browser.takeScreenshot().then(function (png) {
writeScreenShot(png, 'exception.png');
});
element(by.id('indexing')).click(); element(by.id('indexing')).click();
browser.sleep(500); browser.sleep(500);
browser.takeScreenshot().then(function (png) {
writeScreenShot(png, 'exception.png');
});
element(by.id('doctype')).click(); element(by.id('doctype')).click();
browser.sleep(500); browser.sleep(500);
element(by.css('[title="Demande de renseignements"]')).click(); element(by.css('[title="Demande de renseignements"]')).click();
...@@ -47,5 +64,4 @@ describe('index resource page', function() { ...@@ -47,5 +64,4 @@ describe('index resource page', function() {
expect(browser.getCurrentUrl()).toContain('/resources/'); expect(browser.getCurrentUrl()).toContain('/resources/');
browser.sleep(4000); browser.sleep(4000);
}); });
}); });
\ No newline at end of file
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