git ssb

1+

Daan Patchwork / manyverse



Commit e4f3b0fbcc0a98c94a541c063c7e3075c73759b3

dx: update e2e tests for the new UI designs

Andre Staltz committed on 8/22/2018, 7:55:58 PM
Parent: 6eaedc0383a04c5de22424aaaf5caf293cca9e7a

Files changed

e2e/central.jschanged
e2e/compose.jschanged
e2e/drawer.jschanged
e2e/feed.jschanged
e2e/thread.jschanged
e2e/central.jsView
@@ -21,17 +21,25 @@
2121 const wd = require('wd');
2222
2323 module.exports = function(driver, t) {
2424 t.test('Central screen is displayed with 2 tabs', async function(t) {
25- // Public tab
2625 t.ok(
2726 await driver.waitForElementByAndroidUIAutomator(
28- 'new UiSelector().descriptionContains("Feed Text Input")',
27+ 'new UiSelector().text("Messages")',
2928 6000,
3029 ),
31- 'I see Feed Text Input',
30+ 'I see the Messages header in the Central screen',
3231 );
32+ await driver.sleep(6000);
33+ // Public tab
3334 t.ok(
35+ await driver.waitForElementByAndroidUIAutomator(
36+ 'new UiSelector().textContains("No messages")',
37+ 8000,
38+ ),
39+ 'I see the Messages tab body with no messages',
40+ );
41+ t.ok(
3442 await driver.elementByAndroidUIAutomator(
3543 'new UiSelector().descriptionContains("Public Tab Button")',
3644 ),
3745 'I see Public tab button',
@@ -45,26 +53,32 @@
4553 await connectionsTabButton.tap();
4654 t.pass('I tap it');
4755 t.ok(
4856 await driver.elementByAndroidUIAutomator(
49- 'new UiSelector().textContains("Friends around you")',
57+ 'new UiSelector().text("Connections")',
5058 ),
51- 'I see Connections tab body',
59+ 'I see the Connections header in the Central screen',
5260 );
61+ t.ok(
62+ await driver.elementByAndroidUIAutomator(
63+ 'new UiSelector().textContains("No connections")',
64+ ),
65+ 'I see Connections tab body with no connections',
66+ );
5367
5468 const lanHelpButton = await driver.elementByAndroidUIAutomator(
55- 'new UiSelector().descriptionContains("Show LAN Help")',
69+ 'new UiSelector().descriptionContains("Local Network Mode")',
5670 );
57- t.ok(lanHelpButton, 'I see Info button about LAN peers');
71+ t.ok(lanHelpButton, 'I see LAN mode icon');
5872 await lanHelpButton.tap();
5973 t.pass('I tap it');
6074
6175 t.ok(
6276 await driver.waitForElementByAndroidUIAutomator(
63- 'new UiSelector().textContains("This list shows friends")',
77+ 'new UiSelector().textContains("Connect with friends in the same Local Area Network")',
6478 6000,
6579 ),
66- 'I see a text explaining what LAN peers are',
80+ 'I see a text explaining what LAN connectivity is',
6781 );
6882
6983 await driver.back();
7084 t.pass('I press the (hardware) back button');
@@ -76,12 +90,13 @@
7690 t.ok(publicTabButton, 'I see Public Tab button');
7791 await publicTabButton.tap();
7892 t.pass('I tap it');
7993 t.ok(
80- await driver.elementByAndroidUIAutomator(
81- 'new UiSelector().descriptionContains("Feed Text Input")',
94+ await driver.waitForElementByAndroidUIAutomator(
95+ 'new UiSelector().text("Messages")',
96+ 8000,
8297 ),
83- 'I see Feed Text Input',
98+ 'I see the Messages header in the Central screen',
8499 );
85100
86101 t.end();
87102 });
e2e/compose.jsView
@@ -20,19 +20,22 @@
2020 const test = require('tape');
2121
2222 module.exports = function(driver, t) {
2323 t.test('Compose screen allows posting new public message', async function(t) {
24- const feedTextInput = await driver.elementByAndroidUIAutomator(
25- 'new UiSelector().descriptionContains("Feed Text Input")',
24+ t.ok(
25+ await driver.waitForElementByAndroidUIAutomator(
26+ 'new UiSelector().text("Messages")',
27+ 6000,
28+ ),
29+ 'I see the Messages header in the Central screen',
30+ );
31+
32+ const fab = await driver.elementByAndroidUIAutomator(
33+ 'new UiSelector().descriptionContains("Floating Action Button")',
2634 6000,
2735 );
28- t.ok(
29- feedTextInput,
30- 'I see Feed Text Input in the Central screen (Public Tab)',
31- );
32- const f1 = await feedTextInput.text();
33- t.equal(f1, 'Write a public message', 'It shows the placeholder');
34- await feedTextInput.tap();
36+ t.ok(fab, 'I see the Floating Action Button');
37+ await fab.tap();
3538 t.pass('I tap it');
3639 const composeTextInput = await driver.elementByAndroidUIAutomator(
3740 'new UiSelector().descriptionContains("Compose Text Input")',
3841 6000,
@@ -61,16 +64,22 @@
6164 t.end();
6265 });
6366
6467 t.test('Compose screen closes when keyboard gets closed', async function(t) {
65- const feedTextInput = await driver.elementByAndroidUIAutomator(
66- 'new UiSelector().descriptionContains("Feed Text Input")',
68+ t.ok(
69+ await driver.waitForElementByAndroidUIAutomator(
70+ 'new UiSelector().text("Messages")',
71+ 6000,
72+ ),
73+ 'I see the Messages header in the Central screen',
74+ );
75+
76+ const fab = await driver.elementByAndroidUIAutomator(
77+ 'new UiSelector().descriptionContains("Floating Action Button")',
6778 6000,
6879 );
69- t.pass('I see Feed Text Input in the Central screen (Public Tab)');
70- const f1 = await feedTextInput.text();
71- t.equal(f1, 'Write a public message', 'It shows the placeholder');
72- await feedTextInput.tap();
80+ t.pass('I see Floating Action Button');
81+ await fab.tap();
7382 t.pass('I tap it');
7483 const composeTextInput = await driver.elementByAndroidUIAutomator(
7584 'new UiSelector().descriptionContains("Compose Text Input")',
7685 6000,
e2e/drawer.jsView
@@ -94,9 +94,9 @@
9494 await driver.sleep(1000);
9595
9696 t.ok(
9797 await driver.waitForElementByAndroidUIAutomator(
98- 'new UiSelector().descriptionContains("Feed Text Input")',
98+ 'new UiSelector().text("Messages")',
9999 6000,
100100 ),
101101 'I see the Central screen and the Messages tab',
102102 );
e2e/feed.jsView
@@ -21,22 +21,28 @@
2121 const wd = require('wd');
2222
2323 module.exports = function(driver, t) {
2424 t.test('Central screen shows many in scrolling feed', async function(t) {
25+ t.ok(
26+ await driver.elementByAndroidUIAutomator(
27+ 'new UiSelector().text("Messages")',
28+ ),
29+ 'I see the Messages header in the Central screen',
30+ );
2531 await driver.elementByAndroidUIAutomator(
26- 'new UiSelector().descriptionContains("Feed Text Input")',
32+ 'new UiSelector().descriptionContains("Floating Action Button")',
2733 6000,
2834 );
29- t.pass('I see Feed Text Input in the Central screen (Public Tab)');
35+ t.pass('I see the Floating Action Button');
3036
3137 const AMOUNT = 10;
3238 t.pass('I begin creating ' + AMOUNT + ' public messages');
3339 for (let i = 1; i <= AMOUNT; i++) {
34- const feedTextInput = await driver.elementByAndroidUIAutomator(
35- 'new UiSelector().descriptionContains("Feed Text Input")',
40+ const fab = await driver.elementByAndroidUIAutomator(
41+ 'new UiSelector().descriptionContains("Floating Action Button")',
3642 6000,
3743 );
38- await feedTextInput.tap();
44+ await fab.tap();
3945 await driver.sleep(500);
4046 const composeTextInput = await driver.elementByAndroidUIAutomator(
4147 'new UiSelector().descriptionContains("Compose Text Input")',
4248 4000,
@@ -88,14 +94,21 @@
8894 t.end();
8995 });
9096
9197 t.test('A message in the feed can be liked', async function(t) {
92- const feedTextInput = await driver.elementByAndroidUIAutomator(
93- 'new UiSelector().descriptionContains("Feed Text Input")',
98+ t.ok(
99+ await driver.waitForElementByAndroidUIAutomator(
100+ 'new UiSelector().text("Messages")',
101+ 6000,
102+ ),
103+ 'I see the Messages header in the Central screen',
104+ );
105+ const fab = await driver.elementByAndroidUIAutomator(
106+ 'new UiSelector().descriptionContains("Floating Action Button")',
94107 6000,
95108 );
96- t.pass('I see Feed Text Input');
97- await feedTextInput.tap();
109+ t.pass('I see the Floating Action Button');
110+ await fab.tap();
98111 const composeTextInput = await driver.elementByAndroidUIAutomator(
99112 'new UiSelector().descriptionContains("Compose Text Input")',
100113 6000,
101114 );
e2e/thread.jsView
@@ -23,14 +23,21 @@
2323 module.exports = function(driver, t) {
2424 t.test(
2525 'Thread screen can be accessed from reply button in feed',
2626 async function(t) {
27- const feedTextInput = await driver.elementByAndroidUIAutomator(
28- 'new UiSelector().descriptionContains("Feed Text Input")',
27+ t.ok(
28+ await driver.waitForElementByAndroidUIAutomator(
29+ 'new UiSelector().text("Messages")',
30+ 6000,
31+ ),
32+ 'I see the Messages header in the Central screen',
33+ );
34+ const fab = await driver.elementByAndroidUIAutomator(
35+ 'new UiSelector().descriptionContains("Floating Action Button")',
2936 6000,
3037 );
31- t.pass('I see Feed Text Input');
32- await feedTextInput.tap();
38+ t.pass('I tap the Floating Action Button');
39+ await fab.tap();
3340 const composeTextInput = await driver.elementByAndroidUIAutomator(
3441 'new UiSelector().descriptionContains("Compose Text Input")',
3542 6000,
3643 );
@@ -116,9 +123,9 @@
116123 await driver.back();
117124 t.pass('I press the (hardware) back button');
118125 t.ok(
119126 await driver.waitForElementByAndroidUIAutomator(
120- 'new UiSelector().descriptionContains("Feed Text Input")',
127+ 'new UiSelector().descriptionContains("Floating Action Button")',
121128 6000,
122129 ),
123130 'I am on the Central screen with a feed',
124131 );

Built with git-ssb-web