@@ -17,8 +17,8 @@ describe('demo widget', () => {
17
17
browser . reload ( ) ;
18
18
browser . call ( ( ) => renameJob ( jobName , browser ) ) ;
19
19
20
- browserLocal . url ( '/dist-demo/index.html' ) ;
21
- browserRemote . url ( '/dist-demo/index.html' ) ;
20
+ browserLocal . url ( '/dist-demo/index.html?local ' ) ;
21
+ browserRemote . url ( '/dist-demo/index.html?remote ' ) ;
22
22
} ) ;
23
23
24
24
it ( 'create test users' , ( ) => {
@@ -29,86 +29,149 @@ describe('demo widget', () => {
29
29
browser . refresh ( ) ;
30
30
} ) ;
31
31
32
- it ( 'saves token for local user' , ( ) => {
33
- saveToken ( browserLocal , mccoy . token . access_token ) ;
34
- } ) ;
32
+ describe ( 'access token authentication' , ( ) => {
33
+ it ( 'saves token for local user' , ( ) => {
34
+ saveToken ( browserLocal , mccoy . token . access_token ) ;
35
+ } ) ;
35
36
36
- it ( 'saves token for remote user' , ( ) => {
37
- saveToken ( browserRemote , spock . token . access_token ) ;
38
- } ) ;
37
+ it ( 'saves token for remote user' , ( ) => {
38
+ saveToken ( browserRemote , spock . token . access_token ) ;
39
+ } ) ;
39
40
40
- describe ( 'space widget' , ( ) => {
41
- it ( 'opens space widget for mccoy in local' , ( ) => {
42
- browserLocal . click ( elements . toPersonRadioButton ) ;
43
- browserLocal . element ( elements . toPersonInput ) . setValue ( spock . email ) ;
44
- browserLocal . click ( elements . openSpaceWidgetButton ) ;
45
- // Wait for conversation to be ready
46
- const textInputField = `[placeholder="Send a message to ${ spock . displayName } "]` ;
41
+ describe ( 'space widget' , ( ) => {
42
+ it ( 'opens space widget for mccoy in local' , ( ) => {
43
+ browserLocal . click ( elements . toPersonRadioButton ) ;
44
+ browserLocal . element ( elements . toPersonInput ) . setValue ( spock . email ) ;
45
+ browserLocal . click ( elements . openSpaceWidgetButton ) ;
46
+ // Wait for conversation to be ready
47
+ const textInputField = `[placeholder="Send a message to ${ spock . displayName } "]` ;
47
48
48
- browserLocal . waitForVisible ( textInputField ) ;
49
- browserLocal . scroll ( textInputField ) ;
50
- } ) ;
49
+ browserLocal . waitForVisible ( textInputField ) ;
50
+ browserLocal . scroll ( textInputField ) ;
51
+ } ) ;
51
52
52
- it ( 'opens space widget for spock in remote' , ( ) => {
53
- browserRemote . click ( elements . toPersonRadioButton ) ;
54
- browserRemote . element ( elements . toPersonInput ) . setValue ( mccoy . email ) ;
55
- browserRemote . click ( elements . openSpaceWidgetButton ) ;
56
- // Wait for conversation to be ready
57
- const textInputFieldRemote = `[placeholder="Send a message to ${ mccoy . displayName } "]` ;
53
+ it ( 'opens space widget for spock in remote' , ( ) => {
54
+ browserRemote . click ( elements . toPersonRadioButton ) ;
55
+ browserRemote . element ( elements . toPersonInput ) . setValue ( mccoy . email ) ;
56
+ browserRemote . click ( elements . openSpaceWidgetButton ) ;
57
+ // Wait for conversation to be ready
58
+ const textInputFieldRemote = `[placeholder="Send a message to ${ mccoy . displayName } "]` ;
58
59
59
- browserRemote . waitForVisible ( textInputFieldRemote ) ;
60
- browserRemote . scroll ( textInputFieldRemote ) ;
61
- } ) ;
60
+ browserRemote . waitForVisible ( textInputFieldRemote ) ;
61
+ browserRemote . scroll ( textInputFieldRemote ) ;
62
+ } ) ;
62
63
63
- describe ( 'space widget functionality' , ( ) => {
64
- describe ( 'Activity Menu' , ( ) => {
65
- it ( 'has a menu button' , ( ) => {
66
- assert . isTrue ( browserLocal . isVisible ( spaceElements . menuButton ) ) ;
64
+ describe ( 'space widget functionality' , ( ) => {
65
+ describe ( 'Activity Menu' , ( ) => {
66
+ it ( 'has a menu button' , ( ) => {
67
+ assert . isTrue ( browserLocal . isVisible ( spaceElements . menuButton ) ) ;
68
+ } ) ;
69
+
70
+ it ( 'displays the menu when clicking the menu button' , ( ) => {
71
+ browserLocal . click ( spaceElements . menuButton ) ;
72
+ browserLocal . waitForVisible ( spaceElements . activityMenu ) ;
73
+ } ) ;
74
+
75
+ it ( 'has an exit menu button' , ( ) => {
76
+ assert . isTrue ( browserLocal . isVisible ( spaceElements . activityMenu ) ) ;
77
+ browserLocal . waitForVisible ( spaceElements . exitButton ) ;
78
+ } ) ;
79
+
80
+ it ( 'closes the menu with the exit button' , ( ) => {
81
+ browserLocal . click ( spaceElements . exitButton ) ;
82
+ browserLocal . waitForVisible ( spaceElements . activityMenu , 60000 , true ) ;
83
+ } ) ;
67
84
} ) ;
68
85
69
- it ( 'displays the menu when clicking the menu button ', ( ) => {
70
- browserLocal . click ( spaceElements . menuButton ) ;
71
- browserLocal . waitForVisible ( spaceElements . activityMenu ) ;
72
- } ) ;
86
+ describe ( 'messaging ', ( ) => {
87
+ it ( 'sends and receives messages' , ( ) => {
88
+ const martyText = 'Wait a minute. Wait a minute, Doc. Ah... Are you telling me that you built a time machine... out of a DeLorean?' ;
89
+ const docText = 'The way I see it, if you\'re gonna build a time machine into a car, why not do it with some style?' ;
73
90
74
- it ( 'has an exit menu button' , ( ) => {
75
- assert . isTrue ( browserLocal . isVisible ( spaceElements . activityMenu ) ) ;
76
- browserLocal . waitForVisible ( spaceElements . exitButton ) ;
91
+ sendMessage ( remote , local , martyText ) ;
92
+ verifyMessageReceipt ( local , remote , martyText , false ) ;
93
+ sendMessage ( local , remote , docText ) ;
94
+ verifyMessageReceipt ( remote , local , docText , false ) ;
95
+ } ) ;
77
96
} ) ;
78
97
79
- it ( 'closes the menu with the exit button' , ( ) => {
80
- browserLocal . click ( spaceElements . exitButton ) ;
81
- browserLocal . waitForVisible ( spaceElements . activityMenu , 60000 , true ) ;
98
+ describe ( 'external control' , ( ) => {
99
+ it ( 'can change current activity' , ( ) => {
100
+ assert . isTrue ( browserLocal . isVisible ( spaceElements . messageWidget ) ) ;
101
+ browserLocal . click ( elements . changeActivityMeetButton ) ;
102
+ browserLocal . click ( elements . updateSpaceWidgetButton ) ;
103
+ browserLocal . waitForVisible ( spaceElements . meetWidget , 6000 ) ;
104
+ } ) ;
82
105
} ) ;
83
106
} ) ;
107
+ } ) ;
108
+
109
+ describe ( 'recents widget' , ( ) => {
110
+ it ( 'opens recents widget for mccoy in local' , ( ) => {
111
+ browserLocal . click ( elements . openRecentsWidgetButton ) ;
112
+ browserLocal . waitForVisible ( elements . recentsWidgetContainer ) ;
113
+ } ) ;
114
+ } ) ;
115
+ } ) ;
116
+
117
+ describe ( 'sdk instance authentication' , ( ) => {
118
+ it ( 'reloads demo page and stores access token with sdk for local' , ( ) => {
119
+ // Widget demo uses cookies to save info
120
+ browserLocal . deleteCookie ( ) ;
121
+ browserLocal . refresh ( ) ;
122
+
123
+ saveToken ( browserLocal , mccoy . token . access_token , true ) ;
124
+ } ) ;
125
+
126
+ it ( 'reloads demo page and stores access token with sdk for browser' , ( ) => {
127
+ // Widget demo uses cookies to save info
128
+ browserRemote . deleteCookie ( ) ;
129
+ browserRemote . refresh ( ) ;
130
+
131
+ saveToken ( browserRemote , spock . token . access_token , true ) ;
132
+ } ) ;
133
+
134
+ describe ( 'space widget' , ( ) => {
135
+ it ( 'opens space widget for mccoy in local' , ( ) => {
136
+ browserLocal . click ( elements . toPersonRadioButton ) ;
137
+ browserLocal . element ( elements . toPersonInput ) . setValue ( spock . email ) ;
138
+ browserLocal . click ( elements . openSpaceWidgetButton ) ;
139
+ // Wait for conversation to be ready
140
+ const textInputField = `[placeholder="Send a message to ${ spock . displayName } "]` ;
141
+
142
+ browserLocal . waitForVisible ( textInputField ) ;
143
+ browserLocal . scroll ( textInputField ) ;
144
+ } ) ;
145
+
146
+ it ( 'opens space widget for spock in remote' , ( ) => {
147
+ browserRemote . click ( elements . toPersonRadioButton ) ;
148
+ browserRemote . element ( elements . toPersonInput ) . setValue ( mccoy . email ) ;
149
+ browserRemote . click ( elements . openSpaceWidgetButton ) ;
150
+ // Wait for conversation to be ready
151
+ const textInputFieldRemote = `[placeholder="Send a message to ${ mccoy . displayName } "]` ;
152
+
153
+ browserRemote . waitForVisible ( textInputFieldRemote ) ;
154
+ browserRemote . scroll ( textInputFieldRemote ) ;
155
+ } ) ;
84
156
85
157
describe ( 'messaging' , ( ) => {
86
158
it ( 'sends and receives messages' , ( ) => {
87
- const martyText = 'Wait a minute. Wait a minute, Doc. Ah... Are you telling me that you built a time machine... out of a DeLorean ?' ;
88
- const docText = 'The way I see it, if you\'re gonna build a time machine into a car, why not do it with some style? ' ;
159
+ const martyText = 'Doc... what if we don\'t succeed ?' ;
160
+ const docText = 'We must succeed. ' ;
89
161
90
162
sendMessage ( remote , local , martyText ) ;
91
163
verifyMessageReceipt ( local , remote , martyText , false ) ;
92
164
sendMessage ( local , remote , docText ) ;
93
165
verifyMessageReceipt ( remote , local , docText , false ) ;
94
166
} ) ;
95
167
} ) ;
96
-
97
- describe ( 'external control' , ( ) => {
98
- it ( 'can change current activity' , ( ) => {
99
- assert . isTrue ( browserLocal . isVisible ( spaceElements . messageWidget ) ) ;
100
- browserLocal . click ( elements . changeActivityMeetButton ) ;
101
- browserLocal . click ( elements . updateSpaceWidgetButton ) ;
102
- browserLocal . waitForVisible ( spaceElements . meetWidget , 6000 ) ;
103
- } ) ;
104
- } ) ;
105
168
} ) ;
106
- } ) ;
107
169
108
- describe ( 'recents widget' , ( ) => {
109
- it ( 'opens recents widget for mccoy in local' , ( ) => {
110
- browserLocal . click ( elements . openRecentsWidgetButton ) ;
111
- browserLocal . waitForVisible ( elements . recentsWidgetContainer ) ;
170
+ describe ( 'recents widget' , ( ) => {
171
+ it ( 'opens recents widget for mccoy in local' , ( ) => {
172
+ browserLocal . click ( elements . openRecentsWidgetButton ) ;
173
+ browserLocal . waitForVisible ( elements . recentsWidgetContainer ) ;
174
+ } ) ;
112
175
} ) ;
113
176
} ) ;
114
177
0 commit comments