@@ -11,22 +11,18 @@ import loginAndOpenWidget from '../../../lib/test-helpers/tap/space';
11
11
import { createSpace , disconnectDevices , registerDevices , setupGroupTestUsers } from '../../../lib/test-users' ;
12
12
13
13
describe ( 'Widget Space: Group Space: TAP' , ( ) => {
14
- const browserLocal = browser . select ( 'browserLocal' ) ;
15
- const browserRemote = browser . select ( 'browserRemote' ) ;
16
14
let docbrown , lorraine , marty ;
17
15
let conversation , local , remote , participants ;
18
16
19
17
before ( 'load browsers' , ( ) => {
20
- browserLocal
21
- . url ( '/widget-demo/production/index.html?space&local' )
22
- . execute ( ( ) => {
23
- localStorage . clear ( ) ;
24
- } ) ;
25
- browserRemote
26
- . url ( '/widget-demo/production/index.html?space&remote' )
27
- . execute ( ( ) => {
28
- localStorage . clear ( ) ;
29
- } ) ;
18
+ browserLocal . url ( '/widget-demo/production/index.html?space&local' ) ;
19
+ browserLocal . execute ( ( ) => {
20
+ localStorage . clear ( ) ;
21
+ } ) ;
22
+ browserRemote . url ( '/widget-demo/production/index.html?space&remote' ) ;
23
+ browserRemote . execute ( ( ) => {
24
+ localStorage . clear ( ) ;
25
+ } ) ;
30
26
} ) ;
31
27
32
28
before ( 'create test users and spaces' , ( ) => {
@@ -41,54 +37,64 @@ describe('Widget Space: Group Space: TAP', () => {
41
37
before ( 'inject marty token' , ( ) => {
42
38
local = { browser : browserLocal , user : marty , displayName : conversation . displayName } ;
43
39
loginAndOpenWidget ( local . browser , marty . token . access_token , false , conversation . hydraId ) ;
44
- local . browser . waitForExist ( `[placeholder="Send a message to ${ conversation . displayName } "]` , 30000 ) ;
40
+ local . browser . $ ( `[placeholder="Send a message to ${ conversation . displayName } "]` ) . waitForExist ( {
41
+ timeout : 30000
42
+ } ) ;
45
43
} ) ;
46
44
47
45
before ( 'inject docbrown token' , ( ) => {
48
46
remote = { browser : browserRemote , user : docbrown , displayName : conversation . displayName } ;
49
47
loginAndOpenWidget ( remote . browser , docbrown . token . access_token , false , conversation . hydraId ) ;
50
- remote . browser . waitForExist ( `[placeholder="Send a message to ${ conversation . displayName } "]` , 30000 ) ;
48
+ remote . browser . $ ( `[placeholder="Send a message to ${ conversation . displayName } "]` ) . waitForExist ( {
49
+ timeout : 30000
50
+ } ) ;
51
51
} ) ;
52
52
53
53
before ( 'stick widgets to bottom of viewport' , ( ) => {
54
- local . browser . waitForVisible ( elements . stickyButton ) ;
55
- local . browser . click ( elements . stickyButton ) ;
56
- remote . browser . waitForVisible ( elements . stickyButton ) ;
57
- remote . browser . click ( elements . stickyButton ) ;
54
+ local . browser . $ ( elements . stickyButton ) . waitForDisplayed ( ) ;
55
+ local . browser . $ ( elements . stickyButton ) . click ( ) ;
56
+ remote . browser . $ ( elements . stickyButton ) . waitForDisplayed ( ) ;
57
+ remote . browser . $ ( elements . stickyButton ) . click ( ) ;
58
58
} ) ;
59
59
60
60
after ( 'disconnect' , ( ) => Promise . all ( [
61
61
disconnectDevices ( participants ) ,
62
62
// Demos use cookies to save state, clear before moving on
63
- browserLocal . deleteCookie ( ) ,
64
- browserRemote . deleteCookie ( )
63
+ browserLocal . deleteCookies ( ) ,
64
+ browserRemote . deleteCookies ( )
65
65
] ) ) ;
66
66
67
67
describe ( 'Activity Section' , ( ) => {
68
68
it ( 'has a message button' , ( ) => {
69
69
local . browser
70
- . element ( elements . messageActivityButton )
71
- . waitForVisible ( ) ;
70
+ . $ ( elements . messageActivityButton )
71
+ . waitForDisplayed ( ) ;
72
72
} ) ;
73
73
74
74
it ( 'switches to message widget' , ( ) => {
75
- local . browser . element ( elements . messageActivityButton ) . click ( ) ;
75
+ local . browser . $ ( elements . messageActivityButton ) . click ( ) ;
76
76
// Activity menu animates the hide, wait for it to be gone
77
- local . browser . waitForVisible ( elements . activityMenu , 1500 , true ) ;
78
- assert . isTrue ( local . browser . isVisible ( elements . messageWidget ) ) ;
79
- assert . isFalse ( local . browser . isVisible ( elements . meetWidget ) ) ;
77
+ local . browser . $ ( elements . activityMenu ) . waitForDisplayed ( {
78
+ timeout : 1500 ,
79
+ reverse : true
80
+ } ) ;
81
+ assert . isTrue ( local . browser . $ ( elements . messageWidget ) . isDisplayed ( ) ) ;
82
+ assert . isFalse ( local . browser . $ ( elements . meetWidget ) . isDisplayed ( ) ) ;
80
83
} ) ;
81
84
82
85
it ( 'has a meet button' , ( ) => {
83
- local . browser . element ( elements . meetActivityButton ) . waitForVisible ( ) ;
86
+ local . browser . $ ( elements . meetActivityButton ) . waitForDisplayed ( ) ;
84
87
} ) ;
85
88
86
89
it ( 'switches to meet widget' , ( ) => {
87
- local . browser . element ( elements . meetActivityButton ) . click ( ) ;
90
+ local . browser . $ ( elements . meetActivityButton ) . click ( ) ;
88
91
// Activity menu animates the hide, wait for it to be gone
89
- local . browser . waitForVisible ( elements . activityMenu , 1500 , true ) ;
90
- assert . isTrue ( local . browser . isVisible ( elements . meetWidget ) ) ;
91
- assert . isFalse ( local . browser . isVisible ( elements . messageWidget ) ) ;
92
+ local . browser . $ ( elements . activityMenu ) . waitForDisplayed ( {
93
+ timeout : 1500 ,
94
+ reverse : true
95
+ } ) ;
96
+ assert . isTrue ( local . browser . $ ( elements . meetWidget ) . isDisplayed ( ) ) ;
97
+ assert . isFalse ( local . browser . $ ( elements . messageWidget ) . isDisplayed ( ) ) ;
92
98
} ) ;
93
99
} ) ;
94
100
0 commit comments