-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #74 from rogoit/main
Fix typescript errors with copilot.
- Loading branch information
Showing
10 changed files
with
70 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"trailingComma": "all", | ||
"trailingComma": "none", | ||
"tabWidth": 2, | ||
"semi": false, | ||
"singleQuote": true | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
export const ttElementExists = (selector) => { | ||
cy.log('ttElementExists - NCA TESTIFY'); | ||
cy.window().then(($window) => { | ||
return $window.document.querySelector(selector); | ||
return cy.window().then(($window) => { | ||
return $window.document.querySelector(selector) !== null; | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
export const ttElementExists = (selector: string): boolean => { | ||
export const ttElementExists = ( | ||
selector: string | ||
): Cypress.Chainable<boolean> => { | ||
cy.log('ttElementExists - NCA TESTIFY') | ||
cy.window().then(($window) => { | ||
return $window.document.querySelector(selector) | ||
return cy.window().then(($window) => { | ||
return $window.document.querySelector(selector) !== null | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,19 @@ | ||
/** | ||
* Validates that the 'impressum' link is clickable and redirects to the correct page. | ||
* @returns A Cypress Chainable that resolves to a boolean indicating whether the link is clickable and redirects to the correct page. | ||
*/ | ||
export const ttValidateImprintClickable = () => { | ||
cy.log('validateImprintClickable - NCA TESTIFY'); | ||
cy.ttElementExists('.sg-cookie-optin-box-footer-links').then((htmlElement) => { | ||
if (htmlElement) { | ||
cy.contains('.sg-cookie-optin-box-footer-links a', 'impressum', { | ||
matchCase: false, | ||
}).click(); | ||
} | ||
else { | ||
cy.wait(5000); | ||
cy.contains('a:visible', 'impressum', { matchCase: false }).click(); | ||
} | ||
if (cy.ttElementExists('.sg-cookie-optin-box-footer-links')) { | ||
cy.contains('.sg-cookie-optin-box-footer-links a', 'impressum', { | ||
matchCase: false | ||
}).click(); | ||
} | ||
else { | ||
cy.wait(5000); | ||
cy.contains('a:visible', 'impressum', { matchCase: false }).click(); | ||
} | ||
return cy.window().then((win) => { | ||
return win.location.href.includes('/impressum'); | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,20 @@ | ||
export const ttValidateImprintClickable = () => { | ||
/** | ||
* Validates that the 'impressum' link is clickable and redirects to the correct page. | ||
* @returns A Cypress Chainable that resolves to a boolean indicating whether the link is clickable and redirects to the correct page. | ||
*/ | ||
export const ttValidateImprintClickable = (): Cypress.Chainable<boolean> => { | ||
cy.log('validateImprintClickable - NCA TESTIFY') | ||
|
||
cy.ttElementExists('.sg-cookie-optin-box-footer-links').then( | ||
(htmlElement) => { | ||
if (htmlElement) { | ||
cy.contains('.sg-cookie-optin-box-footer-links a', 'impressum', { | ||
matchCase: false, | ||
}).click() | ||
} else { | ||
cy.wait(5000) | ||
cy.contains('a:visible', 'impressum', { matchCase: false }).click() | ||
} | ||
}, | ||
) | ||
if (cy.ttElementExists('.sg-cookie-optin-box-footer-links')) { | ||
cy.contains('.sg-cookie-optin-box-footer-links a', 'impressum', { | ||
matchCase: false | ||
}).click() | ||
} else { | ||
cy.wait(5000) | ||
cy.contains('a:visible', 'impressum', { matchCase: false }).click() | ||
} | ||
|
||
return cy.window().then((win) => { | ||
return win.location.href.includes('/impressum') | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,13 @@ | ||
# Update md file | ||
|
||
2.0.38 | ||
Fix typescript errors | ||
|
||
- ttElementExist boolean and null operator. | ||
- ttValidateImprint use new method signature and improve. | ||
|
||
2.0.37 | ||
Add cy.clearAllLocalStorage() to everyInternalLinkIsLoading for better memory handling. | ||
Update npm dependencies. | ||
Do something for the planet | ||
|
||
- Add cy.clearAllLocalStorage() to everyInternalLinkIsLoading for better memory handling. | ||
- Update npm dependencies. |