Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2568 from desurd/mysmokes
Add new tests for the home web page, for the navigations inside of a …
- Loading branch information
Showing
6 changed files
with
186 additions
and
8 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,62 @@ | ||
# coffee script | ||
# test goal: checks the capability to navigate in a dedicated build | ||
# to use previous and next link | ||
|
||
|
||
forcePage = require('./force.coffee') | ||
builderPage = require('./builder.coffee') | ||
|
||
describe('', () -> | ||
force = null | ||
builder = null | ||
|
||
beforeEach(() -> | ||
builder = new builderPage('runtests', 'force') | ||
force = new forcePage() | ||
builder.goDefault() | ||
) | ||
|
||
|
||
describe 'previousnextlink', () -> | ||
it 'should navigate in the builds history by using the previous next links', () -> | ||
builder.go() | ||
builder.getLastSuccessBuildNumber().then (lastbuild) -> | ||
# Build #1 | ||
builder.go() | ||
builder.goForce() | ||
force.getStartButton().click() | ||
builder.go() | ||
builder.waitNextBuildFinished(lastbuild) | ||
# Build #2 | ||
builder.goForce() | ||
force.getStartButton().click() | ||
builder.go() | ||
builder.waitNextBuildFinished(+lastbuild + 1) | ||
builder.go() | ||
builder.goBuild(lastbuild) | ||
lastBuildURL = browser.getLocationAbsUrl() | ||
builder.getPreviousButton().click() | ||
expect(browser.getLocationAbsUrl()).not.toMatch(lastBuildURL) | ||
builder.getNextButton().click() | ||
expect(browser.getLocationAbsUrl()).toMatch(lastBuildURL) | ||
) | ||
|
||
describe('', () -> | ||
force = null | ||
builder = null | ||
|
||
beforeEach(() -> | ||
builder = new builderPage('slowruntest', 'force') | ||
force = new forcePage() | ||
builder.goDefault() | ||
) | ||
|
||
describe 'forceandstop', () -> | ||
it 'should create a build with a dedicated reason and stop it during execution', () -> | ||
|
||
builder.go() | ||
builder.goForce() | ||
force.getStartButton().click() | ||
expect(browser.getLocationAbsUrl()).toMatch("/builders/\[1-9]/builds/\[1-9]") | ||
builder.getStopButton().click() | ||
) |
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,17 @@ | ||
# 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/ | ||
|
||
class HomePage | ||
#constructor: (@builder)-> | ||
constructor: ()-> | ||
browser.get('#/') | ||
|
||
go: () -> | ||
browser.get('#/') | ||
|
||
getPanel: () -> | ||
return element.all(By.css(".panel-title")) | ||
|
||
module.exports = HomePage |
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,34 @@ | ||
# coffee script | ||
# test goal: checks the the number of element present in home page | ||
# to test this part: two different builds need to be started | ||
|
||
|
||
forcePage = require('./force.coffee') | ||
builderPage = require('./builder.coffee') | ||
homePage = require('./home.coffee') | ||
|
||
|
||
describe('', () -> | ||
force = null | ||
builder = null | ||
home = null | ||
|
||
beforeEach(() -> | ||
builder = new builderPage('runtests', 'force') | ||
force = new forcePage() | ||
home = new homePage() | ||
builder.goDefault() | ||
) | ||
|
||
describe 'manage home web page', () -> | ||
it 'should go to the home page and check the different builder', () -> | ||
builderName = { | ||
"0" : "runtests" | ||
} | ||
builder.go() | ||
builder.goForce() | ||
force.getStartButton().click() | ||
home.go() | ||
panel0 = home.getPanel(0) | ||
expect(panel0.getText()).toContain(builderName[0]) | ||
) |
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,32 @@ | ||
# coffee script | ||
# test goal: checks the capability to navigate in a dedicated build | ||
# to use previous and next link | ||
|
||
|
||
forcePage = require('./force.coffee') | ||
builderPage = require('./builder.coffee') | ||
|
||
describe('', () -> | ||
force = null | ||
builder = null | ||
|
||
beforeEach(() -> | ||
builder = new builderPage('runtests', 'force') | ||
force = new forcePage() | ||
builder.goDefault() | ||
) | ||
|
||
describe 'rebuild button', () -> | ||
it 'should navigate to a dedicated build and to use the rebuild button', () -> | ||
builder.go() | ||
builder.getLastSuccessBuildNumber().then (lastbuild) -> | ||
builder.goForce() | ||
force.getStartButton().click() | ||
builder.go() | ||
builder.waitNextBuildFinished(lastbuild) | ||
builder.goBuild(lastbuild) | ||
browser.getLocationAbsUrl().then (buildUrl) -> | ||
builder.getRebuildButton().click() | ||
builder.waitGoToBuild(lastbuild+2) | ||
|
||
) |