Update protractor jasmine tests

This commit is contained in:
Lukasz.Zeglinski
2019-09-17 21:58:49 +02:00
parent 345ba4d8a8
commit 2c811e07a5
10 changed files with 124 additions and 32 deletions

View File

@@ -1,10 +1,11 @@
describe('Control Page', function() {
var DeviceListPage = require('../devices')
var deviceListPage = new DeviceListPage()
var localhost = browser.baseUrl
var ControlPage = function() {
this.get = function() {
browser.get(protractor.getInstance().baseUrl + 'control')
browser.get(localhost + 'control')
}
this.kickDeviceButton = element.all(by.css('.kick-device')).first()
this.kickDevice = function() {
@@ -26,8 +27,8 @@ describe('Control Page', function() {
browser.sleep(500)
browser.getLocationAbsUrl().then(function(newUrl) {
expect(newUrl).toMatch(protractor.getInstance().baseUrl + 'control')
browser.getCurrentUrl().then(function(newUrl) {
expect(newUrl).toContain(localhost + 'control/')
})
})
@@ -135,10 +136,10 @@ describe('Control Page', function() {
it('should stop controlling an usable device', function() {
controlPage.kickDevice()
waitUrl(/devices/)
browser.wait(waitUrl(/devices/), 5000)
browser.getLocationAbsUrl().then(function(newUrl) {
expect(newUrl).toBe(protractor.getInstance().baseUrl + 'devices')
browser.getCurrentUrl().then(function(newUrl) {
expect(newUrl).toBe(localhost + 'devices')
})
})