From 7d696916467dee891f2f33640fbcc7612f89a984 Mon Sep 17 00:00:00 2001 From: Mario Mol Date: Mon, 8 Feb 2021 21:36:34 -0300 Subject: [PATCH] fix tests --- README.md | 8 +++++++- e2e/app.e2e-spec.ts | 6 ++---- package.json | 5 +++-- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 3ec60e61..beb44f5a 100644 --- a/README.md +++ b/README.md @@ -144,7 +144,13 @@ Its easy to get it set: * You can check the demo gantt that we use for testing features at: `http://127.0.0.1:8080/docs/demo.html` * Use `npm run watch` or do your change in `src` and restart this command refresh the changes. -For testing use `npm run test` with e2e tests. +For testing: +* Install global dependencies: `npm i -g webdriver-manager` +* Install selenium webdriver: `npm run webdriver`, it will install something like node_modules/webdriver-manager/selenium/chromedriver_88.0.4324.96.zip +* Use `npm run test` with e2e tests. +* Or use `npm run watch:test` to keep watching the tests + + Or help us donating... diff --git a/e2e/app.e2e-spec.ts b/e2e/app.e2e-spec.ts index 79068f0d..a1f037f8 100644 --- a/e2e/app.e2e-spec.ts +++ b/e2e/app.e2e-spec.ts @@ -17,13 +17,11 @@ describe('ng-packaged App', () => { it('it should change language from pt to en', () => { page.navigateTo(); - element(by.css('.gtaskheading.gresource')).getText() + element(by.css('.gtaskheading.gres')).getText() .then(t=>{ expect(t).toEqual('Resource'); - element(by.cssContainingText('option', 'pt')).click(); - - return element(by.css('.gtaskheading.gresource')).getText() + return element(by.css('.gtaskheading.gres')).getText() }) .then(t=>{ expect(t).toEqual('Responsável'); diff --git a/package.json b/package.json index 3211981b..7080c9f1 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "build": "tsc", "watch:build": "onchange 'src/**' '*.*' -- npm run build", "watch": "onchange 'src/**' '*.ts' -- npm run dist", - "watch:test": "onchange 'src/**/*.ts' '*.ts' -- npm run test", + "watch:test": "onchange 'src/**/*.ts' '*.ts' 'e2e/**/*.ts' -- npm run test", "test": "npm start & node node_modules/.bin/protractor protractor.conf.js", "test-unit": "mocha -r ts-node/register test/**.ts", "webdriver": "./node_modules/protractor/bin/webdriver-manager update", @@ -29,7 +29,8 @@ }, "homepage": "https://jsganttimproved.github.io/jsgantt-improved/docs/", "dependencies": { - "@types/node": "^12.0.10" + "@types/node": "^12.0.10", + "webdriver-manager": "^12.1.8" }, "devDependencies": { "@types/chai": "^4.1.5",