mirror of
https://github.com/buildbot/buildbot.git
synced 2021-05-20 10:47:20 +03:00
smokes: Use request library to post change hook
jQuery is no longer available to protractor as we use webpack.
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
import { browser, by, element, ExpectedConditions as EC } from 'protractor';
|
||||
import { post } from 'request';
|
||||
import { ConsolePage } from './pages/console';
|
||||
import { BuilderPage } from './pages/builder';
|
||||
import { HomePage } from './pages/home';
|
||||
import { testPageUrl } from './pages/base';
|
||||
|
||||
describe('change hook', function() {
|
||||
let builder = null;
|
||||
@@ -19,16 +21,14 @@ describe('change hook', function() {
|
||||
it('should create a build', async () => {
|
||||
await builder.go();
|
||||
let lastbuild = await builder.getLastSuccessBuildNumber();
|
||||
await browser.executeAsyncScript((done) =>
|
||||
$.post('change_hook/base', {
|
||||
comments:'sd',
|
||||
project:'pyflakes',
|
||||
repository:'git://github.com/buildbot/hello-world.git',
|
||||
author:'foo <foo@bar.com>',
|
||||
revision: 'HEAD',
|
||||
branch:'master'
|
||||
}, done)
|
||||
);
|
||||
await post(`${testPageUrl}/change_hook/base`).form({
|
||||
comments:'sd',
|
||||
project:'pyflakes',
|
||||
repository:'git://github.com/buildbot/hello-world.git',
|
||||
author:'foo <foo@bar.com>',
|
||||
revision: 'HEAD',
|
||||
branch:'master'
|
||||
});
|
||||
await builder.waitNextBuildFinished(lastbuild);
|
||||
await console.go();
|
||||
expect(await console.countSuccess()).toBeGreaterThan(0);
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
// inspired by this methodology
|
||||
// http://www.lindstromhenrik.com/using-protractor-with.jsscript/
|
||||
|
||||
export const testPageUrl = 'http://localhost:8011'
|
||||
|
||||
export class BasePage {
|
||||
// accessors for elements that all pages have have (menu, login, etc)
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
"dependencies": {
|
||||
"jasmine-spec-reporter": "^4.2.1",
|
||||
"protractor": "^5.4.2",
|
||||
"request": "^2.88.0",
|
||||
"ts-node": "~4.1.0",
|
||||
"tslint": "~5.9.1",
|
||||
"typescript": "^2.5.3"
|
||||
|
||||
@@ -770,7 +770,7 @@ readable-stream@~2.3.6:
|
||||
string_decoder "~1.1.1"
|
||||
util-deprecate "~1.0.1"
|
||||
|
||||
request@^2.87.0:
|
||||
request@^2.87.0, request@^2.88.0:
|
||||
version "2.88.0"
|
||||
resolved "https://registry.yarnpkg.com/request/-/request-2.88.0.tgz#9c2fca4f7d35b592efe57c7f0a55e81052124fef"
|
||||
integrity sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==
|
||||
|
||||
Reference in New Issue
Block a user