mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-17 23:53:25 +02:00
Update protractor jasmine tests
This commit is contained in:
@@ -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')
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user