This repository has been archived by the owner on Oct 4, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Iftikhar Ahmad
committed
Nov 17, 2016
1 parent
b83b5aa
commit a620f06
Showing
7 changed files
with
348 additions
and
275 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,7 @@ | ||
function BasePage () { | ||
} | ||
function BasePage() {} | ||
|
||
BasePage.prototype.open = function (path) { | ||
BasePage.prototype.open = function(path) { | ||
browser.url('/' + path) | ||
} | ||
|
||
module.exports = new BasePage() | ||
module.exports = new BasePage() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,85 @@ | ||
var basepage = require('./basepage') | ||
var acPage = require('./access-control-page') | ||
|
||
var installedSnapsPage = Object.create(basepage, { | ||
/** | ||
* define elements | ||
*/ | ||
homepage: { get: function () { return browser.element("header.p-navigation div.p-navigation__logo a[href*='/']"); } }, | ||
store: { get: function () { return browser.element("nav.p-navigation__nav a[href*=store]"); } }, | ||
addsnapicon: { get: function () { return browser.element("div.region-installed div.p-card a[href*=store] svg.p-card__icon"); } }, | ||
settings: { get: function () { return browser.element("nav.p-navigation__nav a[href*=settings]"); } }, | ||
bugreport: { get: function () { return browser.element("div.b-layout__footer a[href*=bugs]"); } }, | ||
browsestore: { get: function () { return browser.element("a=Browse store"); } }, | ||
addmoresnaps: { get: function () { return browser.element("a=Add more snaps for this device"); } }, | ||
installedsnaps: { get: function () { return browser.elements(".p-card h3.js-snap-title"); } }, | ||
homepage: { | ||
get: function() { | ||
return browser.element("header.p-navigation div.p-navigation__logo a[href*='/']"); | ||
} | ||
}, | ||
store: { | ||
get: function() { | ||
return browser.element("nav.p-navigation__nav a[href*=store]"); | ||
} | ||
}, | ||
addsnapicon: { | ||
get: function() { | ||
return browser.element("div.region-installed div.p-card a[href*=store] svg.p-card__icon"); | ||
} | ||
}, | ||
settings: { | ||
get: function() { | ||
return browser.element("nav.p-navigation__nav a[href*=settings]"); | ||
} | ||
}, | ||
bugreport: { | ||
get: function() { | ||
return browser.element("div.b-layout__footer a[href*=bugs]"); | ||
} | ||
}, | ||
browsestore: { | ||
get: function() { | ||
return browser.element("a=Browse store"); | ||
} | ||
}, | ||
addmoresnaps: { | ||
get: function() { | ||
return browser.element("a=Add more snaps for this device"); | ||
} | ||
}, | ||
installedsnaps: { | ||
get: function() { | ||
return browser.elements(".p-card h3.js-snap-title"); | ||
} | ||
}, | ||
/** | ||
* define or overwrite page methods | ||
*/ | ||
open: { value: function() { | ||
browser.deleteCookie(); | ||
acPage.open(); | ||
var valid_token = ""; | ||
browser.call(function () { | ||
return snaputil.getToken().then(function (res){ | ||
valid_token = res.trim(); | ||
open: { | ||
value: function() { | ||
browser.deleteCookie(); | ||
acPage.open(); | ||
var valid_token = ""; | ||
browser.call(function() { | ||
return snaputil.getToken().then(function(res) { | ||
valid_token = res.trim(); | ||
}); | ||
}); | ||
acPage.submit_token(valid_token); | ||
loginpage = browser.element('h2=Installed snaps'); | ||
loginpage.waitForVisible(); | ||
} }, | ||
}); | ||
acPage.submit_token(valid_token); | ||
loginpage = browser.element('h2=Installed snaps'); | ||
loginpage.waitForVisible(); | ||
} | ||
}, | ||
|
||
|
||
snapElement: { | ||
value: function(snap_name) { | ||
|
||
var pcarddeck = browser.element(".p-card-deck"); | ||
pcarddeck.waitForVisible(); | ||
return pcarddeck.element("h3=" + snap_name); | ||
|
||
|
||
snapElement: { value: function (snap_name) { | ||
|
||
var pcarddeck = browser.element(".p-card-deck"); | ||
pcarddeck.waitForVisible(); | ||
return pcarddeck.element("h3="+snap_name); | ||
} | ||
}, | ||
|
||
} }, | ||
|
||
snapwebsnap: { get: function () { return this.snapElement("snapweb"); } } | ||
snapwebsnap: { | ||
get: function() { | ||
return this.snapElement("snapweb"); | ||
} | ||
} | ||
}); | ||
|
||
module.exports = installedSnapsPage | ||
module.exports = installedSnapsPage |
Oops, something went wrong.