@@ -11,7 +11,7 @@ async function checkExternalLink(page, linkName, hasType, hasPrefix, hasURI) {
11
11
if ( linkName ) {
12
12
await page . locator ( 'input[id=name]' ) . fill ( linkName ) ;
13
13
}
14
-
14
+
15
15
if ( hasType ) {
16
16
17
17
// Click the input element
@@ -21,10 +21,10 @@ async function checkExternalLink(page, linkName, hasType, hasPrefix, hasURI) {
21
21
}
22
22
23
23
if ( hasPrefix ) {
24
- // Click the input element
25
- await page . click ( '#prefix' ) ;
26
- await page . waitForTimeout ( 500 ) ;
27
- await page . locator ( '.list-item .item:text("dwc")' ) . click ( ) ;
24
+ // Click the input element
25
+ await page . click ( '#prefix' ) ;
26
+ await page . waitForTimeout ( 500 ) ;
27
+ await page . locator ( '.list-item .item:text("dwc")' ) . click ( ) ;
28
28
29
29
}
30
30
if ( hasURI ) {
@@ -41,15 +41,15 @@ async function checkExternalLink(page, linkName, hasType, hasPrefix, hasURI) {
41
41
await page . reload ( )
42
42
}
43
43
44
- else if ( linkName && hasType && hasPrefix && ! hasURI ) {
44
+ else if ( linkName && hasType && hasPrefix && ! hasURI ) {
45
45
await page . waitForLoadState ( 'load' ) ;
46
46
await page . waitForTimeout ( 1500 ) ;
47
47
// Check if the save button is disabled and reload the page
48
48
const saveButton = page . locator ( 'button#save' ) ;
49
49
await expect ( saveButton ) . toBeDisabled ( ) ;
50
50
await page . reload ( )
51
51
}
52
- else if ( linkName && ! hasType && ! hasPrefix && hasURI ) {
52
+ else if ( linkName && ! hasType && ! hasPrefix && hasURI ) {
53
53
await page . waitForLoadState ( 'load' ) ;
54
54
await page . waitForTimeout ( 1500 ) ;
55
55
// Check if the save button is enable and reload the page
@@ -65,11 +65,11 @@ async function checkExternalLink(page, linkName, hasType, hasPrefix, hasURI) {
65
65
await page . reload ( ) ;
66
66
}
67
67
68
-
68
+
69
69
}
70
70
71
71
async function findExternalLink ( page , linkName ) {
72
-
72
+
73
73
await page . waitForLoadState ( 'load' ) ;
74
74
// Wait for 500 milliseconds
75
75
await page . waitForTimeout ( 500 ) ;
@@ -104,8 +104,8 @@ async function deleteExternalLink(page) {
104
104
await page . waitForSelector ( '.modal' ) ;
105
105
106
106
// Check the modal title and body text
107
- await expect ( page . locator ( '.modal-header' ) ) . toHaveText ( 'Delete External Link' ) ;
108
- await expect ( page . locator ( '.modal-body' ) ) . toContainText ( `Are you sure you wish to delete external link ? ` ) ;
107
+ await expect ( page . locator ( '.modal-header' ) ) . toContainText ( 'Delete External Link' ) ;
108
+ await expect ( page . locator ( '.modal-body' ) ) . toContainText ( `Are you sure you wish to delete external link` ) ;
109
109
110
110
// Click the confirm button in the modal footer
111
111
await page . locator ( '.modal-footer button.variant-filled' ) . click ( ) ;
@@ -121,8 +121,8 @@ async function createExternalLink(page, linkName) {
121
121
122
122
await page . locator ( '#create' ) . click ( ) ;
123
123
await page . waitForTimeout ( 1000 ) ;
124
- // Fill in the name and description if provided
125
-
124
+ // Fill in the name and description if provided
125
+
126
126
await page . locator ( 'input[id=name]' ) . fill ( linkName ) ;
127
127
128
128
await page . click ( '#type' ) ;
@@ -169,7 +169,7 @@ async function editExternalLink(page, linkName) {
169
169
await expect ( await toast . locator ( '.text-base' ) ) . toHaveText ( expectedMessage ) ;
170
170
await toast . locator ( 'button' ) . click ( ) ; // Close the toast
171
171
await page . reload ( ) ;
172
-
172
+
173
173
}
174
174
175
175
async function findEditedExternalLink ( page , linkName ) {
@@ -210,4 +210,4 @@ module.exports = {
210
210
createExternalLink,
211
211
editExternalLink,
212
212
findEditedExternalLink
213
- } ;
213
+ } ;
0 commit comments