git ssb

1+

Daan Patchwork / manyverse



Commit c1b7da759f431646f77224575823b66ec440dfab

dx: update e2e tests for new layout

Andre Staltz committed on 2/4/2020, 7:57:51 PM
Parent: 15f465fffd89a7cadfe4d275721bf104a13d5f2e

Files changed

e2e/central.jschanged
e2e/compose.jschanged
e2e/drawer.jschanged
e2e/feed.jschanged
e2e/thread.jschanged
e2e/central.jsView
@@ -4,29 +4,50 @@
44 module.exports = function(driver, t) {
55 t.test('Central screen is displayed with 2 tabs', async function(t) {
66 t.ok(
77 await driver.waitForElementByAndroidUIAutomator(
8- 'new UiSelector().text("Messages")',
8+ 'new UiSelector().text("Public board")',
99 6000,
1010 ),
11- 'I see the Messages header in the Central screen',
11+ 'I see the Public header in the Central screen',
1212 );
1313 await driver.sleep(3000);
1414 // Public tab
1515 t.ok(
1616 await driver.waitForElementByAndroidUIAutomator(
1717 'new UiSelector().textContains("No messages")',
1818 8000,
1919 ),
20- 'I see the Messages tab body with no messages',
20+ 'I see the Public tab body with no messages',
2121 );
2222 t.ok(
2323 await driver.elementByAndroidUIAutomator(
2424 'new UiSelector().descriptionContains("Public Tab Button")',
2525 ),
2626 'I see Public tab button',
2727 );
2828
29+ // Private tab
30+ const privateTabButton = await driver.elementByAndroidUIAutomator(
31+ 'new UiSelector().descriptionContains("Private Tab Button")',
32+ );
33+ t.ok(privateTabButton, 'I see the Private Tab button');
34+ await privateTabButton.click();
35+ t.pass('I tap it');
36+ t.ok(
37+ await driver.elementByAndroidUIAutomator(
38+ 'new UiSelector().text("Private messages")',
39+ ),
40+ 'I see the Private header in the Central screen',
41+ );
42+ t.ok(
43+ await driver.waitForElementByAndroidUIAutomator(
44+ 'new UiSelector().textContains("Write a private message")',
45+ 8000,
46+ ),
47+ 'I see the Private tab body with no messages',
48+ );
49+
2950 // Connections tab
3051 const connectionsTabButton = await driver.elementByAndroidUIAutomator(
3152 'new UiSelector().descriptionContains("Connections Tab Button")',
3253 );
@@ -87,12 +108,12 @@
87108 await publicTabButton.click();
88109 t.pass('I tap it');
89110 t.ok(
90111 await driver.waitForElementByAndroidUIAutomator(
91- 'new UiSelector().text("Messages")',
112+ 'new UiSelector().text("Public board")',
92113 8000,
93114 ),
94- 'I see the Messages header in the Central screen',
115+ 'I see the Public header in the Central screen',
95116 );
96117
97118 t.end();
98119 });
e2e/compose.jsView
@@ -4,12 +4,12 @@
44 module.exports = function(driver, t) {
55 t.test('Compose screen allows posting new public message', async function(t) {
66 t.ok(
77 await driver.waitForElementByAndroidUIAutomator(
8- 'new UiSelector().text("Messages")',
8+ 'new UiSelector().text("Public board")',
99 6000,
1010 ),
11- 'I see the Messages header in the Central screen',
11+ 'I see the Public header in the Central screen',
1212 );
1313
1414 const fab = await driver.elementByAndroidUIAutomator(
1515 'new UiSelector().descriptionContains("Floating Action Button")',
@@ -242,12 +242,12 @@
242242 t,
243243 ) {
244244 t.ok(
245245 await driver.waitForElementByAndroidUIAutomator(
246- 'new UiSelector().text("Messages")',
246+ 'new UiSelector().text("Public board")',
247247 6000,
248248 ),
249- 'I see the Messages header in the Central screen',
249+ 'I see the Public header in the Central screen',
250250 );
251251
252252 const fab = await driver.elementByAndroidUIAutomator(
253253 'new UiSelector().descriptionContains("Floating Action Button")',
@@ -312,9 +312,9 @@
312312 t.pass('I tap it');
313313
314314 t.ok(
315315 await driver.waitForElementByAndroidUIAutomator(
316- 'new UiSelector().text("Messages")',
316+ 'new UiSelector().text("Public board")',
317317 6000,
318318 ),
319319 'I see the Central screen',
320320 );
@@ -358,9 +358,9 @@
358358 t,
359359 ) {
360360 t.ok(
361361 await driver.waitForElementByAndroidUIAutomator(
362- 'new UiSelector().text("Messages")',
362+ 'new UiSelector().text("Public board")',
363363 6000,
364364 ),
365365 'I see the Central screen',
366366 );
@@ -407,9 +407,9 @@
407407 t.pass('I tap it');
408408
409409 t.ok(
410410 await driver.waitForElementByAndroidUIAutomator(
411- 'new UiSelector().text("Messages")',
411+ 'new UiSelector().text("Public board")',
412412 6000,
413413 ),
414414 'I see the Central screen',
415415 );
@@ -440,9 +440,9 @@
440440 t.pass('I tap it');
441441
442442 t.ok(
443443 await driver.waitForElementByAndroidUIAutomator(
444- 'new UiSelector().text("Messages")',
444+ 'new UiSelector().text("Public board")',
445445 6000,
446446 ),
447447 'I see the Central screen',
448448 );
e2e/drawer.jsView
@@ -228,12 +228,12 @@
228228 await driver.sleep(1000);
229229
230230 t.ok(
231231 await driver.waitForElementByAndroidUIAutomator(
232- 'new UiSelector().text("Messages")',
232+ 'new UiSelector().text("Public board")',
233233 6000,
234234 ),
235- 'I see the Central screen and the Messages tab',
235+ 'I see the Central screen and the Public tab',
236236 );
237237
238238 t.end();
239239 });
e2e/feed.jsView
@@ -34,11 +34,11 @@
3434 module.exports = function(driver, t) {
3535 t.test('Central screen shows messages with Etc button', async function(t) {
3636 t.ok(
3737 await driver.elementByAndroidUIAutomator(
38- 'new UiSelector().text("Messages")',
38+ 'new UiSelector().text("Public board")',
3939 ),
40- 'I see the Messages header in the Central screen',
40+ 'I see the Public header in the Central screen',
4141 );
4242
4343 const chevron = await driver.waitForElementByAndroidUIAutomator(
4444 'new UiSelector().descriptionContains("Etc Button")',
@@ -149,12 +149,12 @@
149149
150150 t.test('A message in the feed can be liked', async function(t) {
151151 t.ok(
152152 await driver.waitForElementByAndroidUIAutomator(
153- 'new UiSelector().text("Messages")',
153+ 'new UiSelector().text("Public board")',
154154 6000,
155155 ),
156- 'I see the Messages header in the Central screen',
156+ 'I see the Public header in the Central screen',
157157 );
158158 const fab = await driver.elementByAndroidUIAutomator(
159159 'new UiSelector().descriptionContains("Floating Action Button")',
160160 6000,
@@ -205,29 +205,32 @@
205205
206206 t.end();
207207 });
208208
209- t.test('I can see that someone has liked a message in the Accounts screen', async function(t) {
210- const likeCount = await driver.waitForElementByAndroidUIAutomator(
211- 'new UiSelector().textContains("Please like this message")' +
212- '.fromParent(' +
213- 'new UiSelector().descriptionContains("Like Count Button")' +
214- ')',
215- 6000,
216- );
217- t.pass('I see the like count');
209+ t.test(
210+ 'I can see that someone has liked a message in the Accounts screen',
211+ async function(t) {
212+ const likeCount = await driver.waitForElementByAndroidUIAutomator(
213+ 'new UiSelector().textContains("Please like this message")' +
214+ '.fromParent(' +
215+ 'new UiSelector().descriptionContains("Like Count Button")' +
216+ ')',
217+ 6000,
218+ );
219+ t.pass('I see the like count');
218220
219- await likeCount.click();
220- t.pass('I tap it')
221+ await likeCount.click();
222+ t.pass('I tap it');
221223
222- const likeList = await driver.waitForElementsByAndroidUIAutomator(
223- 'new UiSelector().descriptionContains("Link To Account")',
224- 6000,
225- )
226- t.equals(likeList.length, 1, 'I see 1 person having liked the message');
224+ const likeList = await driver.waitForElementsByAndroidUIAutomator(
225+ 'new UiSelector().descriptionContains("Link To Account")',
226+ 6000,
227+ );
228+ t.equals(likeList.length, 1, 'I see 1 person having liked the message');
227229
228- await driver.back();
229- t.pass('I press the (hardware) back button');
230+ await driver.back();
231+ t.pass('I press the (hardware) back button');
230232
231- t.end();
232- })
233+ t.end();
234+ },
235+ );
233236 };
e2e/thread.jsView
@@ -6,12 +6,12 @@
66 'Thread screen can be accessed from reply button in feed',
77 async function(t) {
88 t.ok(
99 await driver.waitForElementByAndroidUIAutomator(
10- 'new UiSelector().text("Messages")',
10+ 'new UiSelector().text("Public board")',
1111 6000,
1212 ),
13- 'I see the Messages header in the Central screen',
13+ 'I see the Public header in the Central screen',
1414 );
1515 const fab = await driver.elementByAndroidUIAutomator(
1616 'new UiSelector().descriptionContains("Floating Action Button")',
1717 6000,
@@ -254,9 +254,9 @@
254254 t.pass('I tap it');
255255
256256 t.ok(
257257 await driver.waitForElementByAndroidUIAutomator(
258- 'new UiSelector().text("Messages")',
258+ 'new UiSelector().text("Public board")',
259259 6000,
260260 ),
261261 'I see the Central screen',
262262 );
@@ -347,9 +347,9 @@
347347 t.pass('I tap it');
348348
349349 t.ok(
350350 await driver.waitForElementByAndroidUIAutomator(
351- 'new UiSelector().text("Messages")',
351+ 'new UiSelector().text("Public board")',
352352 6000,
353353 ),
354354 'I see the Central screen',
355355 );
@@ -399,9 +399,9 @@
399399 t.pass('I tap it');
400400
401401 t.ok(
402402 await driver.waitForElementByAndroidUIAutomator(
403- 'new UiSelector().text("Messages")',
403+ 'new UiSelector().text("Public board")',
404404 6000,
405405 ),
406406 'I see the Central screen',
407407 );

Built with git-ssb-web