@@ -3,79 +3,62 @@ import { Page } from 'playwright';
3
3
import { colors } from '../../../src/config.json' ;
4
4
import { anyOf } from '../utils' ;
5
5
6
- const UNSECURED_COLOR = colors . red ;
7
- const SECURE_COLOR = colors . green ;
6
+ const DISCONNECTED_COLOR = colors . red ;
7
+ const CONNECTED_COLOR = colors . green ;
8
8
const WHITE_COLOR = colors . white ;
9
9
10
- const UNSECURE_BUTTON_COLOR = anyOf ( colors . red60 , colors . red80 ) ;
11
- const SECURE_BUTTON_COLOR = anyOf ( colors . green , colors . green90 ) ;
10
+ const DISCONNECTED_BUTTON_COLOR = anyOf ( colors . red , colors . red80 ) ;
11
+ const DISCONNECTING_BUTTON_COLOR = anyOf ( colors . green40 ) ;
12
+ const CONNECTED_BUTTON_COLOR = anyOf ( colors . green , colors . green90 ) ;
12
13
13
14
const getLabel = ( page : Page ) => page . locator ( 'span[role="status"]' ) ;
14
15
const getHeader = ( page : Page ) => page . locator ( 'header' ) ;
15
16
16
17
export async function expectDisconnected ( page : Page ) {
17
18
await expectTunnelState ( page , {
18
- labelText : 'unsecured connection ' ,
19
- labelColor : UNSECURED_COLOR ,
20
- headerColor : UNSECURED_COLOR ,
21
- buttonText : 'secure my connection ' ,
22
- buttonColor : SECURE_BUTTON_COLOR ,
19
+ labelText : 'disconnected ' ,
20
+ labelColor : DISCONNECTED_COLOR ,
21
+ headerColor : DISCONNECTED_COLOR ,
22
+ buttonText : 'connect ' ,
23
+ buttonColor : CONNECTED_BUTTON_COLOR ,
23
24
} ) ;
24
25
}
25
26
26
27
export async function expectConnecting ( page : Page ) {
27
28
await expectTunnelState ( page , {
28
- labelText : 'creating secure connection ' ,
29
+ labelText : 'connecting ' ,
29
30
labelColor : WHITE_COLOR ,
30
- headerColor : SECURE_COLOR ,
31
+ headerColor : CONNECTED_COLOR ,
31
32
buttonText : 'cancel' ,
32
- buttonColor : UNSECURE_BUTTON_COLOR ,
33
+ buttonColor : DISCONNECTED_BUTTON_COLOR ,
33
34
} ) ;
34
35
}
35
36
36
37
export async function expectConnected ( page : Page ) {
37
38
await expectTunnelState ( page , {
38
- labelText : 'secure connection ' ,
39
- labelColor : SECURE_COLOR ,
40
- headerColor : SECURE_COLOR ,
39
+ labelText : 'connected ' ,
40
+ labelColor : CONNECTED_COLOR ,
41
+ headerColor : CONNECTED_COLOR ,
41
42
buttonText : 'disconnect' ,
42
- buttonColor : UNSECURE_BUTTON_COLOR ,
43
+ buttonColor : DISCONNECTED_BUTTON_COLOR ,
43
44
} ) ;
44
45
}
45
46
46
47
export async function expectDisconnecting ( page : Page ) {
47
48
await expectTunnelState ( page , {
48
- headerColor : UNSECURED_COLOR ,
49
- buttonText : 'secure my connection' ,
50
- buttonColor : SECURE_BUTTON_COLOR ,
49
+ labelText : 'disconnecting' ,
50
+ labelColor : WHITE_COLOR ,
51
+ headerColor : DISCONNECTED_COLOR ,
52
+ buttonText : 'connect' ,
53
+ buttonColor : DISCONNECTING_BUTTON_COLOR ,
51
54
} ) ;
52
55
}
53
56
54
57
export async function expectError ( page : Page ) {
55
58
await expectTunnelState ( page , {
56
59
labelText : 'blocked connection' ,
57
60
labelColor : WHITE_COLOR ,
58
- headerColor : SECURE_COLOR ,
59
- } ) ;
60
- }
61
-
62
- export async function expectConnectingPq ( page : Page ) {
63
- await expectTunnelState ( page , {
64
- labelText : 'creating quantum secure connection' ,
65
- labelColor : WHITE_COLOR ,
66
- headerColor : SECURE_COLOR ,
67
- buttonText : 'cancel' ,
68
- buttonColor : UNSECURE_BUTTON_COLOR ,
69
- } ) ;
70
- }
71
-
72
- export async function expectConnectedPq ( page : Page ) {
73
- await expectTunnelState ( page , {
74
- labelText : 'quantum secure connection' ,
75
- labelColor : SECURE_COLOR ,
76
- headerColor : SECURE_COLOR ,
77
- buttonText : 'disconnect' ,
78
- buttonColor : UNSECURE_BUTTON_COLOR ,
61
+ headerColor : CONNECTED_COLOR ,
79
62
} ) ;
80
63
}
81
64
0 commit comments