Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add end user testing for worker web page
Signed-off-by: desurd <david.desurmont@gmail.com>
- Loading branch information
Showing
3 changed files
with
63 additions
and
0 deletions.
There are no files selected for viewing
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,28 @@ | ||
# this file will contains the different generic functions which | ||
# will be called by the different tests | ||
# inspired by this methodology | ||
# http://www.lindstromhenrik.com/using-protractor-with-coffeescript/ | ||
|
||
builderPage = require('./builder.coffee') | ||
|
||
class workerPage | ||
constructor: (builder) -> | ||
@builder = builder | ||
|
||
goWorker: () -> | ||
browser.get('#/workers') | ||
|
||
checkWorkerPage: () -> | ||
expect(browser.getCurrentUrl()).toContain('#/worker') | ||
|
||
checkHrefPresent: () -> | ||
hrefRef = element.all(By.css('a')) | ||
expect(hrefRef.getText()).toContain('slowruntests') | ||
expect(hrefRef.getText()).toContain('runtests') | ||
|
||
goBuilderLink: (builderName) -> | ||
builderLink = element.all(By.linkText(builderName)) | ||
builderLink.click() | ||
return new builderPage(builderName, 'Force') | ||
|
||
module.exports = workerPage |
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,31 @@ | ||
# coffee script | ||
# test goal: checks the capability to navigate on about web page | ||
# to use previous and next link | ||
|
||
workerPage = require('./pages/worker.coffee') | ||
|
||
describe('', () -> | ||
worker = null | ||
builder = null | ||
|
||
beforeEach(() -> | ||
worker = new workerPage('runtests') | ||
) | ||
|
||
describe 'check worker page', () -> | ||
it 'should navigate to the worker page, check the one builder inside', () -> | ||
worker.goWorker() | ||
worker.checkWorkerPage() | ||
worker.checkHrefPresent() | ||
builder = worker.goBuilderLink('slowruntests') | ||
builder.checkBuilderURL() | ||
|
||
describe 'check worker page', () -> | ||
it 'should navigate to the worker page, check the one builder inside', () -> | ||
worker.goWorker() | ||
worker.checkWorkerPage() | ||
worker.checkHrefPresent() | ||
builder = worker.goBuilderLink('runtests') | ||
builder.checkBuilderURL() | ||
|
||
) |