git ssb

1+

Daan Patchwork / manyverse



Commit 8d1cf65caba50a515bda47c0965001293f2ef24e

dx: update e2e tests

Andre Staltz committed on 4/5/2021, 3:39:03 PM
Parent: fe5a1ae4b190c2e6ddb69880daac54c3724456d1

Files changed

e2e/central.jschanged
e2e/compose.jschanged
e2e/drawer.jschanged
e2e/feed.jschanged
e2e/settings.jschanged
e2e/thread.jschanged
e2e/central.jsView
@@ -1,12 +1,12 @@
11 /* Any copyright is dedicated to the Public Domain.
22 * http://creativecommons.org/publicdomain/zero/1.0/ */
33
4-module.exports = function(driver, t) {
5- t.test('Central screen is displayed with three tabs', async function(t) {
4+module.exports = function (driver, t) {
5+ t.test('Central screen is displayed with three tabs', async function (t) {
66 t.ok(
77 await driver.waitForElementByAndroidUIAutomator(
8- 'new UiSelector().text("Public board")',
8+ 'new UiSelector().text("Public posts")',
99 6000,
1010 ),
1111 'I see the Public header in the Central screen',
1212 );
@@ -34,9 +34,9 @@
3434 await privateTabButton.click();
3535 t.pass('I tap it');
3636 t.ok(
3737 await driver.elementByAndroidUIAutomator(
38- 'new UiSelector().text("Private messages")',
38+ 'new UiSelector().text("Private chats")',
3939 ),
4040 'I see the Private header in the Central screen',
4141 );
4242 t.ok(
@@ -46,8 +46,29 @@
4646 ),
4747 'I see the Private tab body with no messages',
4848 );
4949
50+ // Activity tab
51+ const activityTabButton = await driver.elementByAndroidUIAutomator(
52+ 'new UiSelector().descriptionContains("Activity Tab Button")',
53+ );
54+ t.ok(activityTabButton, 'I see the Activity Tab button');
55+ await activityTabButton.click();
56+ t.pass('I tap it');
57+ t.ok(
58+ await driver.elementByAndroidUIAutomator(
59+ 'new UiSelector().text("Activity")',
60+ ),
61+ 'I see the Activity header in the Central screen',
62+ );
63+ t.ok(
64+ await driver.waitForElementByAndroidUIAutomator(
65+ 'new UiSelector().textContains("No activity")',
66+ 8000,
67+ ),
68+ 'I see the Activity tab body with no events',
69+ );
70+
5071 // Connections tab
5172 const connectionsTabButton = await driver.elementByAndroidUIAutomator(
5273 'new UiSelector().descriptionContains("Connections Tab Button")',
5374 );
@@ -108,9 +129,9 @@
108129 await publicTabButton.click();
109130 t.pass('I tap it');
110131 t.ok(
111132 await driver.waitForElementByAndroidUIAutomator(
112- 'new UiSelector().text("Public board")',
133+ 'new UiSelector().text("Public posts")',
113134 8000,
114135 ),
115136 'I see the Public header in the Central screen',
116137 );
e2e/compose.jsView
@@ -1,12 +1,14 @@
11 /* Any copyright is dedicated to the Public Domain.
22 * http://creativecommons.org/publicdomain/zero/1.0/ */
33
4-module.exports = function(driver, t) {
5- t.test('Compose screen allows posting new public message', async function(t) {
4+module.exports = function (driver, t) {
5+ t.test('Compose screen allows posting new public message', async function (
6+ t,
7+ ) {
68 t.ok(
79 await driver.waitForElementByAndroidUIAutomator(
8- 'new UiSelector().text("Public board")',
10+ 'new UiSelector().text("Public posts")',
911 6000,
1012 ),
1113 'I see the Public header in the Central screen',
1214 );
@@ -60,9 +62,9 @@
6062
6163 t.end();
6264 });
6365
64- t.test('Compose screen supports adding a content warning', async t => {
66+ t.test('Compose screen supports adding a content warning', async (t) => {
6567 const fab = await driver.elementByAndroidUIAutomator(
6668 'new UiSelector().descriptionContains("Floating Action Button")',
6769 6000,
6870 );
@@ -242,20 +244,21 @@
242244
243245 t.end();
244246 });
245247
246- t.skip('(TODO) Compose screen allows previewing the markdown', async function(
247- t,
248- ) {
249- t.end();
250- });
248+ t.skip(
249+ '(TODO) Compose screen allows previewing the markdown',
250+ async function (t) {
251+ t.end();
252+ },
253+ );
251254
252- t.test('Compose screen does not close when keyboard closes', async function(
255+ t.test('Compose screen does not close when keyboard closes', async function (
253256 t,
254257 ) {
255258 t.ok(
256259 await driver.waitForElementByAndroidUIAutomator(
257- 'new UiSelector().text("Public board")',
260+ 'new UiSelector().text("Public posts")',
258261 6000,
259262 ),
260263 'I see the Public header in the Central screen',
261264 );
@@ -287,9 +290,9 @@
287290
288291 t.end();
289292 });
290293
291- t.test('Compose screen allows saving draft when exiting', async function(t) {
294+ t.test('Compose screen allows saving draft when exiting', async function (t) {
292295 const composeTextInput = await driver.elementByAndroidUIAutomator(
293296 'new UiSelector().descriptionContains("Compose Text Input")',
294297 6000,
295298 );
@@ -323,9 +326,9 @@
323326 t.pass('I tap it');
324327
325328 t.ok(
326329 await driver.waitForElementByAndroidUIAutomator(
327- 'new UiSelector().text("Public board")',
330+ 'new UiSelector().text("Public posts")',
328331 6000,
329332 ),
330333 'I see the Central screen',
331334 );
@@ -364,14 +367,14 @@
364367
365368 t.end();
366369 });
367370
368- t.test('Compose screen allows deleting draft when exiting', async function(
371+ t.test('Compose screen allows deleting draft when exiting', async function (
369372 t,
370373 ) {
371374 t.ok(
372375 await driver.waitForElementByAndroidUIAutomator(
373- 'new UiSelector().text("Public board")',
376+ 'new UiSelector().text("Public posts")',
374377 6000,
375378 ),
376379 'I see the Central screen',
377380 );
@@ -418,9 +421,9 @@
418421 t.pass('I tap it');
419422
420423 t.ok(
421424 await driver.waitForElementByAndroidUIAutomator(
422- 'new UiSelector().text("Public board")',
425+ 'new UiSelector().text("Public posts")',
423426 6000,
424427 ),
425428 'I see the Central screen',
426429 );
@@ -451,9 +454,9 @@
451454 t.pass('I tap it');
452455
453456 t.ok(
454457 await driver.waitForElementByAndroidUIAutomator(
455- 'new UiSelector().text("Public board")',
458+ 'new UiSelector().text("Public posts")',
456459 6000,
457460 ),
458461 'I see the Central screen',
459462 );
e2e/drawer.jsView
@@ -3,10 +3,10 @@
33
44 const wd = require('wd');
55 const RECOVERY = require('./utils/recovery');
66
7-module.exports = function(driver, t) {
8- t.test('Drawer has some menu items', async function(t) {
7+module.exports = function (driver, t) {
8+ t.test('Drawer has some menu items', async function (t) {
99 await driver.sleep(2000);
1010 // Open drawer
1111 const pressMenu = new wd.TouchAction(driver);
1212 pressMenu.press({x: 80, y: 150});
@@ -44,9 +44,9 @@
4444 );
4545 t.end();
4646 });
4747
48- t.test("Drawer shows user's id", async function(t) {
48+ t.test("Drawer shows user's id", async function (t) {
4949 const partOfId = RECOVERY.id.substr(0, 10);
5050
5151 t.ok(
5252 await driver.waitForElementByAndroidUIAutomator(
@@ -58,9 +58,9 @@
5858
5959 t.end();
6060 });
6161
62- t.test('Drawer can be hidden by sliding', async function(t) {
62+ t.test('Drawer can be hidden by sliding', async function (t) {
6363 await driver.sleep(2000);
6464 // Open drawer
6565 const pressMenu = new wd.TouchAction(driver);
6666 pressMenu.press({x: 80, y: 150});
@@ -81,18 +81,18 @@
8181 await driver.sleep(1000);
8282
8383 t.ok(
8484 await driver.waitForElementByAndroidUIAutomator(
85- 'new UiSelector().text("Public board")',
85+ 'new UiSelector().text("Public posts")',
8686 6000,
8787 ),
8888 'I see the Central screen and the Public tab',
8989 );
9090
9191 t.end();
9292 });
9393
94- t.test('Drawer has a link to the Settings screen', async function(t) {
94+ t.test('Drawer has a link to the Settings screen', async function (t) {
9595 await driver.sleep(2000);
9696 // Open drawer
9797 const pressMenu = new wd.TouchAction(driver);
9898 pressMenu.press({x: 80, y: 150});
e2e/feed.jsView
@@ -30,13 +30,13 @@
3030 if (await conditionFn()) return;
3131 }
3232 }
3333
34-module.exports = function(driver, t) {
35- t.test('Central screen shows messages with Etc button', async function(t) {
34+module.exports = function (driver, t) {
35+ t.test('Central screen shows messages with Etc button', async function (t) {
3636 t.ok(
3737 await driver.elementByAndroidUIAutomator(
38- 'new UiSelector().text("Public board")',
38+ 'new UiSelector().text("Public posts")',
3939 ),
4040 'I see the Public header in the Central screen',
4141 );
4242
@@ -69,9 +69,9 @@
6969
7070 t.end();
7171 });
7272
73- t.test('Central screen shows many in scrolling feed', async function(t) {
73+ t.test('Central screen shows many in scrolling feed', async function (t) {
7474 const fab1 = await driver.elementByAndroidUIAutomator(
7575 'new UiSelector().descriptionContains("Floating Action Button")',
7676 6000,
7777 );
@@ -142,16 +142,16 @@
142142
143143 t.end();
144144 });
145145
146- t.skip('(TODO) Feed displays follows and blocks', async function(t) {
146+ t.skip('(TODO) Feed displays follows and blocks', async function (t) {
147147 t.end();
148148 });
149149
150- t.test('A message in the feed can be liked', async function(t) {
150+ t.test('A message in the feed can be liked', async function (t) {
151151 t.ok(
152152 await driver.waitForElementByAndroidUIAutomator(
153- 'new UiSelector().text("Public board")',
153+ 'new UiSelector().text("Public posts")',
154154 6000,
155155 ),
156156 'I see the Public header in the Central screen',
157157 );
@@ -237,9 +237,9 @@
237237 });
238238
239239 t.test(
240240 'I can see that someone has reacted to a message in the Reactions screen',
241- async function(t) {
241+ async function (t) {
242242 let reactions;
243243 try {
244244 reactions = await driver.waitForElementByAndroidUIAutomator(
245245 'new UiSelector().textContains("Please like this message")' +
e2e/settings.jsView
@@ -31,10 +31,10 @@
3131 if (await conditionFn()) return;
3232 }
3333 }
3434
35-module.exports = function(driver, t) {
36- t.test('Settings screen shows toggle for follows', async function(t) {
35+module.exports = function (driver, t) {
36+ t.test('Settings screen shows toggle for follows', async function (t) {
3737 await driver.sleep(3000);
3838
3939 t.ok(
4040 await driver.waitForElementByAndroidUIAutomator(
@@ -45,9 +45,9 @@
4545 );
4646 t.end();
4747 });
4848
49- t.test('Settings screen shows toggle for detailed logs', async function(t) {
49+ t.test('Settings screen shows toggle for detailed logs', async function (t) {
5050 await scrollDownUntil(driver, async () => {
5151 try {
5252 return !!(await driver.waitForElementByAndroidUIAutomator(
5353 'new UiSelector().textContains("Enable detailed logs")',
@@ -84,9 +84,9 @@
8484
8585 t.end();
8686 });
8787
88- t.test('Settings screen can show the About modal', async function(t) {
88+ t.test('Settings screen can show the About modal', async function (t) {
8989 await scrollDownUntil(driver, async () => {
9090 try {
9191 return !!(await driver.waitForElementByAndroidUIAutomator(
9292 'new UiSelector().descriptionContains("About This App")',
@@ -122,9 +122,9 @@
122122
123123 t.end();
124124 });
125125
126- t.test('Settings screen shows a Backup option', async function(t) {
126+ t.test('Settings screen shows a Backup option', async function (t) {
127127 await scrollUpUntil(driver, async () => {
128128 try {
129129 return !!(await driver.waitForElementByAndroidUIAutomator(
130130 'new UiSelector().descriptionContains("Back Up My Account")',
@@ -253,9 +253,9 @@
253253 t.pass('I tap it');
254254
255255 t.ok(
256256 await driver.waitForElementByAndroidUIAutomator(
257- 'new UiSelector().text("Public board")',
257+ 'new UiSelector().text("Public posts")',
258258 6000,
259259 ),
260260 'I see the Central screen and the Public tab',
261261 );
e2e/thread.jsView
@@ -1,14 +1,14 @@
11 /* Any copyright is dedicated to the Public Domain.
22 * http://creativecommons.org/publicdomain/zero/1.0/ */
33
4-module.exports = function(driver, t) {
4+module.exports = function (driver, t) {
55 t.test(
66 'Thread screen can be accessed from reply button in feed',
7- async function(t) {
7+ async function (t) {
88 t.ok(
99 await driver.waitForElementByAndroidUIAutomator(
10- 'new UiSelector().text("Public board")',
10+ 'new UiSelector().text("Public posts")',
1111 6000,
1212 ),
1313 'I see the Public header in the Central screen',
1414 );
@@ -66,9 +66,9 @@
6666 t.end();
6767 },
6868 );
6969
70- t.test('Thread screen shows messages with Etc button', async function(t) {
70+ t.test('Thread screen shows messages with Etc button', async function (t) {
7171 const chevron = await driver.waitForElementByAndroidUIAutomator(
7272 'new UiSelector().descriptionContains("Etc Button")',
7373 6000,
7474 );
@@ -97,9 +97,9 @@
9797
9898 t.end();
9999 });
100100
101- t.test('Thread screen allows adding a reply', async function(t) {
101+ t.test('Thread screen allows adding a reply', async function (t) {
102102 const replyTextInput = await driver.elementByAndroidUIAutomator(
103103 'new UiSelector().descriptionContains("Reply Text Input")',
104104 6000,
105105 );
@@ -130,25 +130,25 @@
130130
131131 t.end();
132132 });
133133
134- t.skip('(TODO) Thread screen opens for a msg cypherlink', async function(t) {
134+ t.skip('(TODO) Thread screen opens for a msg cypherlink', async function (t) {
135135 t.end();
136136 });
137137
138- t.skip('(TODO) Thread screen alerts missing msg cypherlink', async function(
138+ t.skip('(TODO) Thread screen alerts missing msg cypherlink', async function (
139139 t,
140140 ) {
141141 t.end();
142142 });
143143
144- t.skip('(TODO) Thread screen alerts blocked msg cypherlink', async function(
144+ t.skip('(TODO) Thread screen alerts blocked msg cypherlink', async function (
145145 t,
146146 ) {
147147 t.end();
148148 });
149149
150- t.test('Thread screen allows going back to feed', async function(t) {
150+ t.test('Thread screen allows going back to feed', async function (t) {
151151 t.ok(
152152 await driver.waitForElementByAndroidUIAutomator(
153153 'new UiSelector().descriptionContains("Reply Text Input")',
154154 6000,
@@ -168,9 +168,11 @@
168168
169169 t.end();
170170 });
171171
172- t.test('Thread screen allows opening full-screen Compose', async function(t) {
172+ t.test('Thread screen allows opening full-screen Compose', async function (
173+ t,
174+ ) {
173175 t.ok(
174176 await driver.waitForElementByAndroidUIAutomator(
175177 'new UiSelector().textContains("Do you like dogs")',
176178 6000,
@@ -247,9 +249,9 @@
247249
248250 t.end();
249251 });
250252
251- t.test('Thread screen allows saving draft reply on exit', async function(t) {
253+ t.test('Thread screen allows saving draft reply on exit', async function (t) {
252254 await driver.back();
253255 t.pass('I press the (hardware) back button');
254256
255257 t.ok(
@@ -268,9 +270,9 @@
268270 t.pass('I tap it');
269271
270272 t.ok(
271273 await driver.waitForElementByAndroidUIAutomator(
272- 'new UiSelector().text("Public board")',
274+ 'new UiSelector().text("Public posts")',
273275 6000,
274276 ),
275277 'I see the Central screen',
276278 );
@@ -332,9 +334,9 @@
332334
333335 t.end();
334336 });
335337
336- t.test('Compose screen allows deleting draft when exiting', async function(
338+ t.test('Compose screen allows deleting draft when exiting', async function (
337339 t,
338340 ) {
339341 const replyTextInput = await driver.waitForElementByAndroidUIAutomator(
340342 'new UiSelector().descriptionContains("Reply Text Input")',
@@ -369,9 +371,9 @@
369371 t.pass('I tap it');
370372
371373 t.ok(
372374 await driver.waitForElementByAndroidUIAutomator(
373- 'new UiSelector().text("Public board")',
375+ 'new UiSelector().text("Public posts")',
374376 6000,
375377 ),
376378 'I see the Central screen',
377379 );
@@ -429,9 +431,9 @@
429431 t.pass('I tap it');
430432
431433 t.ok(
432434 await driver.waitForElementByAndroidUIAutomator(
433- 'new UiSelector().text("Public board")',
435+ 'new UiSelector().text("Public posts")',
434436 6000,
435437 ),
436438 'I see the Central screen',
437439 );

Built with git-ssb-web