This repository has been archived by the owner on Aug 1, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Protractor E2E-Testing with sample
- Loading branch information
1 parent
2c7075f
commit 05cf27d
Showing
4 changed files
with
66 additions
and
1 deletion.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
...ature-app-default/{{+pkg_scope}}/{{pkg_name}}/src/home-view/HomeViewComponent.spec-e2e.ts
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import {browser, by} from 'protractor'; | ||
|
||
describe('AppComponent', () => { | ||
|
||
it('should display "Welcome Home"', (done) => { | ||
browser.get('http://localhost:8080<%= app_ctx_root %>'); | ||
browser | ||
.findElement(by.xpath('.//h1')) | ||
.then(el => el.getText()) | ||
.then(innerText => { | ||
expect(innerText).toBe('Welcome Home', 'Wrong inner text. Did HomeViewComponent-Template change?'); | ||
done(); | ||
}) | ||
.catch((err) => { | ||
fail(err); | ||
done(); | ||
}); | ||
}); | ||
}); |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
let path = require('path'); | ||
|
||
// An example configuration file | ||
exports.config = { | ||
// The address of a running selenium server. | ||
seleniumAddress: 'http://localhost:4444/wd/hub', | ||
seleniumArgs: [], | ||
jvmArgs: [], | ||
// Capabilities to be passed to the webdriver instance. | ||
capabilities: { | ||
browserName: 'chrome' | ||
}, | ||
|
||
// Spec patterns are relative to the configuration file location passed | ||
// to protractor (in this example conf.js). | ||
// They may include glob patterns. | ||
specs: [ | ||
'../src/**/*e2e.{ts,js}', | ||
'../packages/**/*e2e.{ts,js}' | ||
], | ||
|
||
// Options to be passed to Jasmine-node. | ||
jasmineNodeOpts: { | ||
showColors: true, // Use colors in the command line report. | ||
defaultTimeoutInterval: 15000 | ||
}, | ||
|
||
beforeLaunch: function() { | ||
require('ts-node').register({ | ||
project: path.resolve(__dirname, '../'), | ||
compiler: 'typescript' | ||
}); | ||
} | ||
}; | ||
|
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