Add e2e test for waterfall tag

This commit is contained in:
Rajdeep Bharati
2019-07-30 20:07:25 +05:30
parent 7531fbdc3a
commit 0245d9cd5e
3 changed files with 26 additions and 1 deletions

View File

@@ -2,7 +2,7 @@
// will be called by the different tests
import { BasePage } from "./base";
import { browser, by, element, ExpectedConditions as EC } from 'protractor';
import { browser, by, element, ExpectedConditions as EC, By } from 'protractor';
export class WaterfallPage extends BasePage {
builder: string;
@@ -70,4 +70,16 @@ export class WaterfallPage extends BasePage {
await localBuilder.click();
await this.checkBuilder();
}
async goTagAndCheck() {
const firstTag = element.all(By.binding('tag'));
await firstTag.click();
expect(browser.getCurrentUrl()).toContain(firstTag.getText());
}
async goUrlAndCheckTag() {
await browser.get('#/waterfall?tags=runt');
const selectedTag = element(by.className('label-success'));
expect(browser.getCurrentUrl()).toContain(selectedTag.getText());
}
}

View File

@@ -42,4 +42,14 @@ describe('waterfall', function() {
await waterfall.go();
await waterfall.goBuildAndClose();
});
it('should click on tag and check if url is changed', async () => {
await waterfall.go();
await waterfall.goTagAndCheck();
});
it('should go to url containing a tag and check if tag is clicked', async () => {
await waterfall.go();
await waterfall.goUrlAndCheckTag();
});
});

View File

@@ -79,16 +79,19 @@ slowfactory.addStep(steps.ShellCommand(command=["sleep", "10"]))
c['builders'] = []
c['builders'].append(
util.BuilderConfig(name="runtests",
tags=['runt'],
workernames=["example-worker"],
factory=factory))
c['builders'].append(
util.BuilderConfig(name="slowruntests",
tags=['slow', 'runt'],
workernames=["example-worker"],
factory=slowfactory))
for i in range(NUM_BUILDERS):
c['builders'].append(
util.BuilderConfig(name="runtests" + str(i),
tags=[str(i), 'runt'],
workernames=["example-worker"],
factory=factory))