New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add new tests for the home web page, for the navigations inside of a … #2568
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those are good tests overall.
Please submit them in separated PRs so that it will be easier for review and faster to merge the good ones.
describe 'manage waterfall', () -> | ||
it 'should navigate to the waterfall and check the different builder', () -> | ||
browser.get('#/builders/1/builds/15') | ||
#lastBuildURL = browser.getLocationAbsUrl() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please remove commented code
# force.getStartButton().click() | ||
# browser.waitForAngular() | ||
# browser.sleep(4000) | ||
#lastBuildURL = browser.getLocationAbsUrl() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove commented code
force.getStartButton().click() | ||
#browser.get('#/builders/1/builds/15') | ||
home.go() | ||
alltitles = element.all(By.css(".panel-title")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we probably want to abstract those in homePage.getPanel(0), homePage.getPanel(1)
|
||
describe 'manage home web page', () -> | ||
it 'should go to the home page and check the different builder', () -> | ||
researchData = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
researchData? just call it builderNames. I dont think this is stable to hardcode the order like this.
I think the home page builder order is undefined. We should define it to order it by buildername.
This will make the test more stable to environement changes
browser.get('#/') | ||
|
||
module.exports = HomePage | ||
# getBuilderReference(reference): -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this was a good start..
builder.goForce() | ||
force.getStartButton().click() | ||
browser.waitForAngular() | ||
browser.sleep(4000) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why those sleeps? Try to avoid them as this slows down a lot the tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need this time out to be sure that the build is really started and to avoid to group the request
this time out will be reduced to 2000
second solution: to add a parameter which forbids the request group capability
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to wait the build is started in the UI.
When the force button is pushed you go to the buildrequest page, when the build is started you will automatically go to the build page.
So you can just poll until the current page is a build page to now that the build has started.
1aa9db4
to
4238da2
Compare
This needs a rebase |
builder.go() | ||
builder.waitNextBuildFinished(+lastbuild + 1) | ||
builder.go() | ||
builder.getLastSuccessBuildNumber().then (lastbuild) -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need to get LastBuildNumber again, it will be lastbuild + 2
describe 'rebuild button', () -> | ||
it 'should navigate to a dedicated build and to use the rebuild button', () -> | ||
builder.go() | ||
builder.getLastSuccessBuildNumber().then (buildValue) -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In order for this to work you need to ensure there is at least one build.
1665000
to
fd4378b
Compare
builder.getRebuildButton().click() | ||
browser.getLocationAbsUrl().then (buildUrl) -> | ||
# expect than build keyword is present in buildURL | ||
expect(buildUrl.indexOf("builds") != "-1" ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is racy as if the build does not start fast enough, we will still be in buildrequest page.
So we rather need to add a browser.wait instead of expect
b32b169
to
e7d6bcc
Compare
builder.goBuild(lastbuild) | ||
browser.getLocationAbsUrl().then (buildUrl) -> | ||
builder.getRebuildButton().click() | ||
browser.getLocationAbsUrl().then (buildUrl) -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
builder.waitGoToBuild(lastbuild+1)
browser.wait(buildCountIncrement, 10000) | ||
|
||
buildsContents: (buildURL, lastbuild) -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
waitGoToBuild: (expected_buildnumber) ->
isInBuild = () ->
browser.getLocationAbsUrl().then (buildUrl) ->
split = buildURL.split("/")
builds_part = split[split.lenght-2]
if builds_part != "builds"
return false
split = buildURL.split("/")
number = +split[split.lenght-1]
if number != expected_buildnumber
return false
return true
browser.wait(isInBuild, 10000)
browser.wait(buildCountIncrement, 10000) | ||
|
||
buildsContents: (buildURL, lastbuild) -> | ||
buildElement = () -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why did you keep this code? is it used
54505ed
to
661e945
Compare
…build reference (previous, next functions), for the rebuild function Signed-off-by: desurd <david.desurmont@gmail.com>
…build reference
(previous, next functions), for the rebuild function
Signed-off-by: desurd david.desurmont@gmail.com
Remove this paragraph
Please have a look at our developer documentation before submitting your Pull Request.
http://trac.buildbot.net/wiki/Development
And especially:
http://trac.buildbot.net/wiki/SubmittingPatches
Contributor Checklist: