-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathtest-pipeline.spec.js
30 lines (26 loc) · 1.16 KB
/
test-pipeline.spec.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
const CookieBar = require('./components/cookiebar.component');
const TestPipelinePage = require('./pages/test-pipeline.page');
describe('Test A Pipeline Page tests', function() {
let cookiebar = new CookieBar();
let testPipelinePage = new TestPipelinePage();
let EC = protractor.ExpectedConditions;
beforeEach(function() {
browser.get("#!/test-pipeline");
//browser.sleep(1000);
browser.wait(EC.presenceOf(testPipelinePage.configuration), 10000);
cookiebar.closeIfPresent();
});
it('Should return a result after testing a pipeline', function() {
testPipelinePage.testPipeline('Protractor test for Test A Pipeline page');
testPipelinePage.result.getText().then(function(text) {
expect(text).toBe('Hello World');
});
});
it('Should return an alert message when testing a pipeline without selecting an adapter', function() {
testPipelinePage.messageField.sendKeys('Oops, forgot to select an adapter');
testPipelinePage.btnSend.click();
testPipelinePage.alertMessage.getText().then(function(text) {
expect(text).toBe('Please specify an adapter!');
});
});
});