@@ -10,13 +10,9 @@ describe('OKR Objective Alignment e2e tests', () => {
10
10
cy . getByTestId ( 'add-objective' ) . first ( ) . click ( ) ;
11
11
12
12
cy . getByTestId ( 'title' ) . first ( ) . clear ( ) . type ( 'Objective with new alignment' ) ;
13
- cy . get ( 'select#alignment option:selected' ) . should ( 'contain.text' , 'Bitte wählen' ) ;
14
- cy . get ( 'select#alignment' )
15
- . contains ( 'K - Steigern der URS um 25%' )
16
- . then ( ( $option ) => {
17
- const optionValue = $option . attr ( 'value' ) ;
18
- cy . get ( 'select#alignment' ) . select ( optionValue ! ) ;
19
- } ) ;
13
+ cy . tabForwardUntil ( '[data-testId="alignmentInput"]' ) ;
14
+ cy . realPress ( 'ArrowDown' ) ;
15
+ cy . realPress ( 'Enter' ) ;
20
16
21
17
cy . getByTestId ( 'safe' ) . click ( ) ;
22
18
@@ -31,20 +27,18 @@ describe('OKR Objective Alignment e2e tests', () => {
31
27
. contains ( 'Objective bearbeiten' )
32
28
. click ( ) ;
33
29
34
- cy . get ( 'select#alignment option:selected' ) . should ( 'contain.text' , 'K - Steigern der URS um 25%' ) ;
30
+ cy . getByTestId ( 'alignmentInput' )
31
+ . first ( )
32
+ . should ( 'have.value' , 'O - Als BBT wollen wir den Arbeitsalltag der Members von Puzzle ITC erleichtern.' ) ;
35
33
} ) ;
36
34
37
35
it ( `Update alignment of Objective` , ( ) => {
38
36
cy . getByTestId ( 'add-objective' ) . first ( ) . click ( ) ;
39
37
40
38
cy . getByTestId ( 'title' ) . first ( ) . clear ( ) . type ( 'We change alignment of this Objective' ) ;
41
- cy . get ( 'select#alignment option:selected' ) . should ( 'contain.text' , 'Bitte wählen' ) ;
42
- cy . get ( 'select#alignment' )
43
- . contains ( 'K - Steigern der URS um 25%' )
44
- . then ( ( $option ) => {
45
- const optionValue = $option . attr ( 'value' ) ;
46
- cy . get ( 'select#alignment' ) . select ( optionValue ! ) ;
47
- } ) ;
39
+ cy . tabForwardUntil ( '[data-testId="alignmentInput"]' ) ;
40
+ cy . realPress ( 'ArrowDown' ) ;
41
+ cy . realPress ( 'Enter' ) ;
48
42
cy . getByTestId ( 'safe' ) . click ( ) ;
49
43
50
44
cy . contains ( 'We change alignment of this Objective' ) ;
@@ -58,12 +52,11 @@ describe('OKR Objective Alignment e2e tests', () => {
58
52
. contains ( 'Objective bearbeiten' )
59
53
. click ( ) ;
60
54
61
- cy . get ( 'select#alignment' )
62
- . contains ( 'K - Antwortzeit für Supportanfragen um 33% verkürzen.' )
63
- . then ( ( $option ) => {
64
- const optionValue = $option . attr ( 'value' ) ;
65
- cy . get ( 'select#alignment' ) . select ( optionValue ! ) ;
66
- } ) ;
55
+ cy . tabForwardUntil ( '[data-testId="alignmentInput"]' ) ;
56
+ cy . realPress ( 'Delete' ) ;
57
+ cy . realPress ( 'ArrowDown' ) ;
58
+ cy . realPress ( 'ArrowDown' ) ;
59
+ cy . realPress ( 'Enter' ) ;
67
60
cy . getByTestId ( 'safe' ) . click ( ) ;
68
61
69
62
cy . getByTestId ( 'objective' )
@@ -76,23 +69,18 @@ describe('OKR Objective Alignment e2e tests', () => {
76
69
. contains ( 'Objective bearbeiten' )
77
70
. click ( ) ;
78
71
79
- cy . get ( 'select#alignment option:selected' ) . should (
80
- 'contain.text' ,
81
- 'K - Antwortzeit für Supportanfragen um 33% verkürzen.' ,
82
- ) ;
72
+ cy . getByTestId ( 'alignmentInput' )
73
+ . first ( )
74
+ . should ( 'have.value' , 'KR - Das BBT hilft den Membern 20% mehr beim Töggelen' ) ;
83
75
} ) ;
84
76
85
77
it ( `Delete alignment of Objective` , ( ) => {
86
78
cy . getByTestId ( 'add-objective' ) . first ( ) . click ( ) ;
87
79
88
80
cy . getByTestId ( 'title' ) . first ( ) . clear ( ) . type ( 'We delete the alignment' ) ;
89
- cy . get ( 'select#alignment option:selected' ) . should ( 'contain.text' , 'Bitte wählen' ) ;
90
- cy . get ( 'select#alignment' )
91
- . contains ( 'K - Steigern der URS um 25%' )
92
- . then ( ( $option ) => {
93
- const optionValue = $option . attr ( 'value' ) ;
94
- cy . get ( 'select#alignment' ) . select ( optionValue ! ) ;
95
- } ) ;
81
+ cy . tabForwardUntil ( '[data-testId="alignmentInput"]' ) ;
82
+ cy . realPress ( 'ArrowDown' ) ;
83
+ cy . realPress ( 'Enter' ) ;
96
84
cy . getByTestId ( 'safe' ) . click ( ) ;
97
85
98
86
cy . contains ( 'We delete the alignment' ) ;
@@ -106,7 +94,9 @@ describe('OKR Objective Alignment e2e tests', () => {
106
94
. contains ( 'Objective bearbeiten' )
107
95
. click ( ) ;
108
96
109
- cy . get ( 'select#alignment' ) . select ( 'Kein Alignment' ) ;
97
+ cy . tabForwardUntil ( '[data-testId="alignmentInput"]' ) ;
98
+ cy . realPress ( 'Delete' ) ;
99
+ cy . tabForward ( ) ;
110
100
cy . getByTestId ( 'safe' ) . click ( ) ;
111
101
112
102
cy . getByTestId ( 'objective' )
@@ -119,28 +109,36 @@ describe('OKR Objective Alignment e2e tests', () => {
119
109
. contains ( 'Objective bearbeiten' )
120
110
. click ( ) ;
121
111
122
- cy . get ( 'select#alignment option:selected ') . should ( 'contain.text ' , 'Bitte wählen' ) ;
112
+ cy . getByTestId ( 'alignmentInput ') . first ( ) . should ( 'have.value ' , 'Bezug wählen' ) ;
123
113
} ) ;
124
114
125
- it ( `Alignment Possibilites change when quarter change` , ( ) => {
115
+ it ( `Alignment Possibilities change when quarter change` , ( ) => {
126
116
cy . visit ( '/?quarter=1' ) ;
127
117
118
+ cy . get ( 'mat-chip:visible:contains("Alle")' ) . click ( ) ;
119
+ cy . get ( 'mat-chip:visible:contains("Alle")' ) . click ( ) ;
120
+ cy . get ( 'mat-chip:visible:contains("/BBT")' ) . click ( ) ;
121
+
128
122
cy . getByTestId ( 'add-objective' ) . first ( ) . click ( ) ;
129
123
cy . getByTestId ( 'title' ) . first ( ) . clear ( ) . type ( 'We can link later on this' ) ;
130
124
cy . getByTestId ( 'safe' ) . click ( ) ;
131
125
126
+ cy . get ( 'mat-chip:visible:contains("Alle")' ) . click ( ) ;
127
+
132
128
cy . getByTestId ( 'add-objective' ) . first ( ) . click ( ) ;
133
129
cy . getByTestId ( 'title' ) . first ( ) . clear ( ) . type ( 'There is my other alignment' ) ;
134
- cy . get ( 'select#alignment option:selected' ) . should ( 'contain.text' , 'Bitte wählen ') ;
135
-
136
- cy . get ( 'select#alignment' ) . select ( 1 ) ;
130
+ cy . tabForwardUntil ( '[data-testId="alignmentInput"] ') ;
131
+ cy . realPress ( 'ArrowDown' ) ;
132
+ cy . realPress ( 'Enter' ) ;
137
133
138
134
cy . get ( 'select#alignment option:selected' ) . then ( ( $select ) => {
139
135
const selectValue = $select . text ( ) ;
140
- cy . getByTestId ( 'quarterSelect' ) . select ( 'GJ 23/24-Q1 ' ) ;
136
+ cy . getByTestId ( 'quarterSelect' ) . select ( 'GJ 22/23-Q3 ' ) ;
141
137
cy . getByTestId ( 'title' ) . first ( ) . clear ( ) . type ( 'There is our other alignment' ) ;
142
138
143
- cy . get ( 'select#alignment' ) . select ( 1 ) ;
139
+ cy . tabForwardUntil ( '[data-testId="alignmentInput"]' ) ;
140
+ cy . realPress ( 'ArrowDown' ) ;
141
+ cy . realPress ( 'Enter' ) ;
144
142
145
143
cy . get ( 'select#alignment option:selected' ) . should ( 'not.contain.text' , selectValue ) ;
146
144
cy . getByTestId ( 'cancel' ) . click ( ) ;
@@ -152,7 +150,9 @@ describe('OKR Objective Alignment e2e tests', () => {
152
150
153
151
cy . get ( 'select#quarter' ) . select ( 'GJ 22/23-Q4' ) ;
154
152
cy . getByTestId ( 'title' ) . first ( ) . clear ( ) . type ( 'A new title' ) ;
155
- cy . get ( 'select#alignment' ) . select ( 1 ) ;
153
+ cy . tabForwardUntil ( '[data-testId="alignmentInput"]' ) ;
154
+ cy . realPress ( 'ArrowDown' ) ;
155
+ cy . realPress ( 'Enter' ) ;
156
156
157
157
cy . get ( 'select#alignment option:selected' ) . should ( 'contain.text' , selectValue ) ;
158
158
} ) ;
0 commit comments