Skip to content

Commit 0ecacee

Browse files
committed
replace deprecated nightwatch calls
1 parent e6986a4 commit 0ecacee

22 files changed

Lines changed: 164 additions & 165 deletions

tests/apps/backgrounding.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,15 @@ module.exports["Install"] = function (browser) {
3434
.init()
3535
.loginDevAccount()
3636
.installApp("http://sandstorm.io/apps/jparyani/background-test-0.spk", "dbed78d1ef5ed4a4f8193e829672623e", "duvq9t519fdcpetkk2s1axe1hdy91zc5svhzas2yfqpn8df9cd40")
37-
.assert.containsText("#grainTitle", "Untitled SandstormTest");
37+
.assert.textContains("#grainTitle", "Untitled SandstormTest");
3838
};
3939

4040
module.exports["Test Notification"] = function (browser) {
4141
browser
4242
// We'll use the debugLog at the bottom of the test, but it's nice to open it early and give it time to load.
4343
.click("#openDebugLog")
4444
.waitForElementVisible(".topbar .notifications .count", short_wait)
45-
.assert.containsText(".topbar .notifications .count", "1")
45+
.assert.textContains(".topbar .notifications .count", "1")
4646
.click(".topbar .notifications>.show-popup")
4747
.waitForElementNotPresent(".topbar .notifications .count", short_wait)
4848
.click(".notification-list .notification-item button")
@@ -51,8 +51,8 @@ module.exports["Test Notification"] = function (browser) {
5151
browser
5252
.switchWindow(windows.value[1])
5353
.waitForElementVisible(".grainlog-contents > pre", short_wait)
54-
.assert.containsText(".grainlog-contents > pre", "Grain has enabled backgrounding")
55-
.assert.containsText(".grainlog-contents > pre", "Grain's backgrounding has been disabled")
54+
.assert.textContains(".grainlog-contents > pre", "Grain has enabled backgrounding")
55+
.assert.textContains(".grainlog-contents > pre", "Grain's backgrounding has been disabled")
5656
.closeWindow()
5757
.end();
5858
});
@@ -63,23 +63,23 @@ module.exports["Install Wakelock Dropper"] = function (browser) {
6363
.init()
6464
.loginDevAccount()
6565
.installApp("http://sandstorm.io/apps/jparyani/background-test-drop-wakelock-1.spk", "963745fa41d602dfc7467cac2e1597b5", "duvq9t519fdcpetkk2s1axe1hdy91zc5svhzas2yfqpn8df9cd40")
66-
.assert.containsText("#grainTitle", "Untitled SandstormTest");
66+
.assert.textContains("#grainTitle", "Untitled SandstormTest");
6767
};
6868

6969
module.exports["Test Notification Wakelock Dropper"] = function (browser) {
7070
browser
7171
// We'll use the debugLog at the bottom of the test, but it's nice to open it early and give it time to load.
7272
.click("#openDebugLog")
7373
.waitForElementVisible(".topbar .notifications .count", short_wait)
74-
.assert.containsText(".topbar .notifications .count", "1")
74+
.assert.textContains(".topbar .notifications .count", "1")
7575
.pause(short_wait)
7676
.windowHandles(function (windows) {
7777
browser
7878
.switchWindow(windows.value[1])
7979
.waitForElementVisible(".grainlog-contents > pre", short_wait)
80-
.assert.containsText(".grainlog-contents > pre", "Grain has enabled backgrounding")
80+
.assert.textContains(".grainlog-contents > pre", "Grain has enabled backgrounding")
8181
.pause(18000) // After 15 seconds, the app will drop its wakelock
82-
.assert.containsText(".grainlog-contents > pre", "Grain's backgrounding has been disabled")
82+
.assert.textContains(".grainlog-contents > pre", "Grain's backgrounding has been disabled")
8383
.closeWindow()
8484
.end();
8585
});

tests/apps/collections.js

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ module.exports["Test Collections"] = function (browser) {
120120

121121
.grainFrame(grainIdC)
122122
.waitForElementVisible(".description-row p", short_wait)
123-
.assert.containsText(".description-row p", "This is Collection C")
123+
.assert.textContains(".description-row p", "This is Collection C")
124124
.waitForElementVisible(".description-row button.description-button", short_wait)
125125
.frame(null)
126126

@@ -131,19 +131,19 @@ module.exports["Test Collections"] = function (browser) {
131131
.url(browser.launch_url + "/grain/" + grainIdA)
132132
.grainFrame()
133133
.waitForElementVisible(".description-row p", short_wait)
134-
.assert.containsText(".description-row p", "This is Collection A")
134+
.assert.textContains(".description-row p", "This is Collection A")
135135
.waitForElementVisible(".description-row button.description-button", short_wait)
136136

137137
.waitForElementVisible("table.grain-list-table>tbody>tr.add-grain>td>button", short_wait)
138138
.waitForElementVisible("table.grain-list-table>tbody tr:nth-child(2).grain", short_wait)
139-
.assert.containsText("table.grain-list-table>tbody tr:nth-child(2).grain td>button",
139+
.assert.textContains("table.grain-list-table>tbody tr:nth-child(2).grain td>button",
140140
"Collection B")
141141
.click("table.grain-list-table>tbody tr:nth-child(2).grain .click-to-go")
142142
.frame(null)
143143

144144
.grainFrame(grainIdB)
145145
.waitForElementVisible(".description-row p", short_wait)
146-
.assert.containsText(".description-row p", "This is Collection B")
146+
.assert.textContains(".description-row p", "This is Collection B")
147147
.waitForElementVisible(".description-row button.description-button", short_wait)
148148

149149
// As Bob, add collection A to collection B, creating a cycle of references.
@@ -166,15 +166,15 @@ module.exports["Test Collections"] = function (browser) {
166166
.grainFrame(grainIdA)
167167
.waitForElementVisible("table.grain-list-table>tbody>tr.add-grain>td>button", short_wait)
168168
.waitForElementVisible("table.grain-list-table>tbody tr:nth-child(3).grain", short_wait)
169-
.assert.containsText("table.grain-list-table>tbody tr:nth-child(3).grain td>button",
169+
.assert.textContains("table.grain-list-table>tbody tr:nth-child(3).grain td>button",
170170
"Collection C")
171171
.click("table.grain-list-table>tbody tr:nth-child(3).grain .click-to-go")
172172
.frame(null)
173173

174174
.grainFrame(grainIdC)
175175
.waitForElementVisible(".description-row p", short_wait)
176-
.assert.containsText(".description-row p", "This is Collection C")
177-
.assert.elementNotPresent(".description-row button.description-button")
176+
.assert.textContains(".description-row p", "This is Collection C")
177+
.assert.not.elementPresent(".description-row button.description-button")
178178

179179
.frame(null)
180180
.executeAsync(function (carolAccountId, grainIdB, done) {
@@ -195,22 +195,22 @@ module.exports["Test Collections"] = function (browser) {
195195
.url(browser.launch_url + "/grain/" + grainIdB)
196196
.grainFrame()
197197
.waitForElementVisible(".description-row p", short_wait)
198-
.assert.containsText(".description-row p", "This is Collection B")
198+
.assert.textContains(".description-row p", "This is Collection B")
199199
.waitForElementVisible(".description-row button.description-button", short_wait)
200200

201201
.waitForElementVisible("table.grain-list-table>tbody tr:nth-child(2).grain",
202202
short_wait)
203-
.assert.containsText("table.grain-list-table>tbody tr:nth-child(2).grain td>button",
203+
.assert.textContains("table.grain-list-table>tbody tr:nth-child(2).grain td>button",
204204
"Collection A")
205205
.click("table.grain-list-table>tbody tr:nth-child(2).grain .click-to-go")
206206

207207
.grainFrame(grainIdA)
208208

209209
.waitForElementVisible(".description-row p", short_wait)
210-
.assert.containsText(".description-row p", "This is Collection A")
210+
.assert.textContains(".description-row p", "This is Collection A")
211211

212212
// Carol does not have edit permissions.
213-
.assert.elementNotPresent(".description-row button.description-button")
213+
.assert.not.elementPresent(".description-row button.description-button")
214214
.frame(null)
215215

216216
.execute("window.Meteor.logout()")
@@ -226,7 +226,7 @@ module.exports["Test Collections"] = function (browser) {
226226
short_wait)
227227
.waitForElementVisible("table.grain-list-table>tbody tr:nth-child(2).grain",
228228
short_wait)
229-
.assert.containsText("table.grain-list-table>tbody tr:nth-child(2).grain td>button",
229+
.assert.textContains("table.grain-list-table>tbody tr:nth-child(2).grain td>button",
230230
"Collection B")
231231
.click("table.grain-list-table>tbody tr:nth-child(2).grain td>input[type=checkbox]")
232232
.waitForElementVisible(".bulk-action-buttons>button[title='unlink selected grains']",
@@ -301,17 +301,17 @@ module.exports["Test collections anonymous user"] = function (browser) {
301301
.click(".popup.login button.close-popup")
302302
.grainFrame()
303303
.waitForElementVisible(".description-row p", short_wait)
304-
.assert.containsText(".description-row p", "This is Collection A")
304+
.assert.textContains(".description-row p", "This is Collection A")
305305
.waitForElementVisible(".description-row button.description-button", short_wait)
306306
.waitForElementVisible("table.grain-list-table>tbody tr:nth-child(1).grain", short_wait)
307-
.assert.containsText("table.grain-list-table>tbody tr:nth-child(1).grain td>button",
307+
.assert.textContains("table.grain-list-table>tbody tr:nth-child(1).grain td>button",
308308
"Collection B")
309309
.click("table.grain-list-table>tbody tr:nth-child(1).grain .click-to-go")
310310
.frame(null)
311311

312312
.grainFrame(grainIdB)
313313
.waitForElementVisible(".description-row p", short_wait)
314-
.assert.containsText(".description-row p", "This is Collection B")
314+
.assert.textContains(".description-row p", "This is Collection B")
315315
.waitForElementVisible(".description-row button.description-button", short_wait)
316316

317317
.frame(null)

tests/apps/ip-networking.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ module.exports["Test Ip Networking"] = function (browser) {
3838
.installApp("https://alpha-hlngxit86q1mrs2iplnx.sandstorm.io/test-11.spk",
3939
"9e431ec70f1ee66901bb73f48687f485",
4040
"rwyva77wj1pnj01cjdj2kvap7c059n9ephyyg5k4s5enh5yw9rxh")
41-
.assert.containsText("#grainTitle", "Untitled Test App test page")
41+
.assert.textContains("#grainTitle", "Untitled Test App test page")
4242
.waitForElementVisible('.grain-frame', short_wait)
4343
.grainFrame()
4444
.waitForElementVisible("#powerbox-request-ipnetwork", short_wait)
@@ -52,7 +52,7 @@ module.exports["Test Ip Networking"] = function (browser) {
5252
.setValue("form.test-ip-network input[type=text]", "http://build.sandstorm.io")
5353
.click("form.test-ip-network button")
5454
.waitForElementVisible("form.test-ip-network div.result", short_wait)
55-
.assert.containsText("form.test-ip-network div.result", "301 Moved Permanently")
55+
.assert.textContains("form.test-ip-network div.result", "301 Moved Permanently")
5656
.frameParent()
5757
};
5858

@@ -62,7 +62,7 @@ module.exports["Test Ip Interface"] = function (browser) {
6262
.installApp("https://alpha-hlngxit86q1mrs2iplnx.sandstorm.io/test-11.spk",
6363
"9e431ec70f1ee66901bb73f48687f485",
6464
"rwyva77wj1pnj01cjdj2kvap7c059n9ephyyg5k4s5enh5yw9rxh")
65-
.assert.containsText("#grainTitle", "Untitled Test App test page")
65+
.assert.textContains("#grainTitle", "Untitled Test App test page")
6666
.waitForElementVisible('.grain-frame', short_wait)
6767
.grainFrame()
6868
.waitForElementVisible("#powerbox-request-ipinterface", short_wait)
@@ -76,12 +76,12 @@ module.exports["Test Ip Interface"] = function (browser) {
7676
.setValue("form.test-ip-interface input[type=number]", IP_INTERFACE_TEST_PORT)
7777
.click("form.test-ip-interface button")
7878
.waitForElementVisible("form.test-ip-interface div.result", short_wait)
79-
.assert.containsText("form.test-ip-interface div.result", "listening on")
79+
.assert.textContains("form.test-ip-interface div.result", "listening on")
8080
.frameParent()
8181
.assertTcpConnection(IP_INTERFACE_TEST_PORT, "tcptest")
8282
.grainFrame()
8383
.waitForElementNotPresent("form.test-ip-interface input[disabled]", short_wait)
84-
.assert.containsText("form.test-ip-interface div.result", "success")
84+
.assert.textContains("form.test-ip-interface div.result", "success")
8585
.frameParent()
8686
.end();
8787
};

tests/apps/powerbox.js

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,13 @@ module.exports["Test Powerbox"] = function (browser) {
3838
.installApp("http://sandstorm.io/apps/david/sandstorm-powerbox-test-app4.spk",
3939
"f855d3c96e18e785a3a734a49919ef18",
4040
"ygpudg61w49gg0x1t2gw4p7q2q7us24gxsyr1as1hf0ezn2uycth")
41-
.assert.containsText("#grainTitle", "Untitled PowerboxTest")
41+
.assert.textContains("#grainTitle", "Untitled PowerboxTest")
4242
.waitForElementVisible('.grain-frame', short_wait)
4343
.grainFrame()
4444
.waitForElementVisible("#offer", short_wait)
4545
.click("#offer")
4646
.waitForElementVisible("#offer-result", short_wait)
47-
.assert.containsText("#offer-result", "offer: success")
47+
.assert.textContains("#offer-result", "offer: success")
4848
.frameParent()
4949
.waitForElementVisible("#powerbox-offer-url", short_wait)
5050
.getText("#powerbox-offer-url", function (result) {
@@ -58,7 +58,7 @@ module.exports["Test Powerbox"] = function (browser) {
5858
.click("#powerbox-request-form button")
5959
.grainFrame()
6060
.waitForElementVisible("#request-result", short_wait)
61-
.assert.containsText("#request-result", "request: footest");
61+
.assert.textContains("#request-result", "request: footest");
6262
});
6363
};
6464

@@ -71,13 +71,13 @@ module.exports["Test PowerboxSave"] = function (browser) {
7171
.installApp("http://sandstorm.io/apps/david/sandstorm-powerbox-test-app4.spk",
7272
"f855d3c96e18e785a3a734a49919ef18",
7373
"ygpudg61w49gg0x1t2gw4p7q2q7us24gxsyr1as1hf0ezn2uycth")
74-
.assert.containsText("#grainTitle", "Untitled PowerboxTest")
74+
.assert.textContains("#grainTitle", "Untitled PowerboxTest")
7575
.waitForElementVisible('.grain-frame', short_wait)
7676
.grainFrame()
7777
.waitForElementVisible("#offer", short_wait)
7878
.click("#offer")
7979
.waitForElementVisible("#offer-result", short_wait)
80-
.assert.containsText("#offer-result", "offer: success")
80+
.assert.textContains("#offer-result", "offer: success")
8181
.frameParent()
8282
.waitForElementVisible("#powerbox-offer-url", short_wait)
8383
.getText("#powerbox-offer-url", function (result) {
@@ -91,7 +91,7 @@ module.exports["Test PowerboxSave"] = function (browser) {
9191
.click("#powerbox-request-form button")
9292
.grainFrame()
9393
.waitForElementVisible("#request-result", short_wait)
94-
.assert.containsText("#request-result", "request: footest");
94+
.assert.textContains("#request-result", "request: footest");
9595
});
9696
};
9797

@@ -104,7 +104,7 @@ module.exports["Test Powerbox with failing requirements"] = function (browser) {
104104
.installApp("http://sandstorm.io/apps/david/sandstorm-powerbox-test-app4.spk",
105105
"f855d3c96e18e785a3a734a49919ef18",
106106
"ygpudg61w49gg0x1t2gw4p7q2q7us24gxsyr1as1hf0ezn2uycth")
107-
.assert.containsText("#grainTitle", "Untitled PowerboxTest")
107+
.assert.textContains("#grainTitle", "Untitled PowerboxTest")
108108

109109
// We'll use the debugLog at the bottom of the test, but it's nice to open it early and give it time to load.
110110
.click("#openDebugLog")
@@ -113,7 +113,7 @@ module.exports["Test Powerbox with failing requirements"] = function (browser) {
113113
.waitForElementVisible("#offer", short_wait)
114114
.click("#offer")
115115
.waitForElementVisible("#offer-result", short_wait)
116-
.assert.containsText("#offer-result", "offer: success")
116+
.assert.textContains("#offer-result", "offer: success")
117117
.frameParent()
118118
.waitForElementVisible("#powerbox-offer-url", short_wait)
119119
.getText("#powerbox-offer-url", function (result) {
@@ -127,12 +127,12 @@ module.exports["Test Powerbox with failing requirements"] = function (browser) {
127127
.click("#powerbox-request-form button")
128128
.grainFrame()
129129
.waitForElementVisible("#request-result", short_wait)
130-
.assert.containsText("#request-result", "request:")
130+
.assert.textContains("#request-result", "request:")
131131
.windowHandles(function (windows) {
132132
browser
133133
.switchWindow(windows.value[1])
134134
.waitForElementVisible(".grainlog-contents > pre", short_wait)
135-
.assert.containsText(".grainlog-contents > pre", "Error: Capability revoked because a user involved in introducing it no longer has the necessary permissions")
135+
.assert.textContains(".grainlog-contents > pre", "Error: Capability revoked because a user involved in introducing it no longer has the necessary permissions")
136136
});
137137
})
138138
.end();
@@ -143,7 +143,7 @@ module.exports["Test Powerbox embedded request flow"] = function (browser) {
143143
.init()
144144
.loginDevAccount()
145145
.uploadTestApp()
146-
.assert.containsText("#grainTitle", "Untitled Sandstorm Test App instance")
146+
.assert.textContains("#grainTitle", "Untitled Sandstorm Test App instance")
147147
.url(function (grainUrl) {
148148
var grainId = grainUrl.value.split("/").pop();
149149
var cardSelector = ".powerbox-card button[data-card-id=\"grain-" + grainId + "\"]";
@@ -154,7 +154,7 @@ module.exports["Test Powerbox embedded request flow"] = function (browser) {
154154
.waitForElementVisible(actionSelector, short_wait)
155155
.click(actionSelector)
156156
.waitForElementVisible("#grainTitle", medium_wait)
157-
.assert.containsText("#grainTitle", "Untitled Sandstorm Test App instance")
157+
.assert.textContains("#grainTitle", "Untitled Sandstorm Test App instance")
158158
.grainFrame()
159159
.waitForElementPresent("#do-powerbox-request", medium_wait)
160160
.click("#do-powerbox-request")
@@ -169,7 +169,7 @@ module.exports["Test Powerbox embedded request flow"] = function (browser) {
169169
.frameParent()
170170
.grainFrame()
171171
.waitForElementVisible("#result-text", short_wait)
172-
.assert.containsText("#result-text", "foo bar baz");
172+
.assert.textContains("#result-text", "foo bar baz");
173173
});
174174
};
175175

@@ -205,7 +205,7 @@ module.exports["Test Powerbox query"] = function (browser) {
205205
if (expectedMatches[id]) {
206206
browser.assert.elementPresent(cardSelector);
207207
} else {
208-
browser.assert.elementNotPresent(cardSelector);
208+
browser.assert.not.elementPresent(cardSelector);
209209
}
210210
}
211211

tests/apps/roundcube.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ module.exports["Install"] = function (browser) {
2828
browser
2929
.loginDevAccount()
3030
.installApp("http://sandstorm.io/apps/jparyani/roundcube-6.spk", "373a821a7a9cde5b13258922046fe217", "0qhha1v9ne1p42s5jw7r6qq6rt5tcx80zpg1f5ptsg7ryr4hws1h")
31-
.assert.containsText("#grainTitle", "Untitled Roundcube mailbox");
31+
.assert.textContains("#grainTitle", "Untitled Roundcube mailbox");
3232
};
3333

3434

@@ -60,7 +60,7 @@ module.exports["Incoming Mail"] = function (browser) {
6060
.pause(short_wait) // It's sad, but there's no good way to wait for the mail to be delivered other than pausing
6161
.click(".mailbox.inbox > a") // This is equivalent to refreshing the inbox
6262
.waitForElementVisible("#messagelist tbody tr:nth-child(1)", short_wait)
63-
.assert.containsText("#messagelist tbody tr:nth-child(1) .subject", "Hello world email");
63+
.assert.textContains("#messagelist tbody tr:nth-child(1) .subject", "Hello world email");
6464
}
6565
});
6666
});

0 commit comments

Comments
 (0)