Skip to content
Merged

V72 #142

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions dist/api-version.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export declare enum APIVersion {
'latest' = "latest",
'default' = "default",
'v14' = "v14"
'latest' = 'latest',
'default' = 'default',
'v14' = 'v14'
}
18 changes: 9 additions & 9 deletions dist/api-version.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.APIVersion = void 0;
var APIVersion;
(function (APIVersion) {
APIVersion["latest"] = "latest";
APIVersion["default"] = "default";
APIVersion["v14"] = "v14";
})(APIVersion || (exports.APIVersion = APIVersion = {}));
'use strict'
Object.defineProperty(exports, '__esModule', { value: true })
exports.APIVersion = void 0
var APIVersion
;(function (APIVersion) {
APIVersion['latest'] = 'latest'
APIVersion['default'] = 'default'
APIVersion['v14'] = 'v14'
})(APIVersion || (exports.APIVersion = APIVersion = {}))
2 changes: 1 addition & 1 deletion dist/commands.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export {};
export {}
120 changes: 78 additions & 42 deletions dist/commands.js
Original file line number Diff line number Diff line change
@@ -1,44 +1,80 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
'use strict'
Object.defineProperty(exports, '__esModule', { value: true })
/// <reference types="cypress" />
// @ts-nocheck - Cypress commands registration bypasses TypeScript checking
const tt_accessibility_1 = require("./commands/tt-accessibility");
const tt_click_if_element_exist_1 = require("./commands/tt-click-if-element-exist");
const tt_cookie_all_accept_1 = require("./commands/tt-cookie-all-accept");
const tt_detect_http_1 = require("./commands/tt-detect-http");
const tt_element_exists_1 = require("./commands/tt-element-exists");
const tt_every_internal_link_is_loading_1 = require("./commands/tt-every-internal-link-is-loading");
const tt_every_internal_link_status_ok_1 = require("./commands/tt-every-internal-link-status-ok");
const tt_get_internal_links_1 = require("./commands/tt-get-internal-links");
const tt_invalid_path_404_1 = require("./commands/tt-invalid-path-404");
const tt_only_one_h1_1 = require("./commands/tt-only-one-h1");
const tt_page_loaded_1 = require("./commands/tt-page-loaded");
const tt_setup_console_error_listener_1 = require("./commands/tt-setup-console-error-listener");
const tt_threshold_1 = require("./commands/tt-threshold");
const tt_validate_all_images_response_status_ok_1 = require("./commands/tt-validate-all-images-response-status-ok");
const tt_validate_imprint_clickable_1 = require("./commands/tt-validate-imprint-clickable");
const tt_validate_language_tag_1 = require("./commands/tt-validate-language-tag");
const tt_validate_no_google_services_1 = require("./commands/tt-validate-no-google-services");
const tt_validate_page_content_1 = require("./commands/tt-validate-page-content");
const tt_validate_subpages_and_images_1 = require("./commands/tt-validate-subpages-and-images");
const tt_el_1 = require("./commands/tt-el");
Cypress.Commands.add('ttEl', tt_el_1.ttEl);
Cypress.Commands.add('ttAccessibility', tt_accessibility_1.ttAccessibility);
Cypress.Commands.add('ttClickIfElementExist', tt_click_if_element_exist_1.ttClickIfElementExist);
Cypress.Commands.add('ttCookieAllAcceptClick', tt_cookie_all_accept_1.ttCookieAllAcceptClick);
Cypress.Commands.add('ttDetectHttp', tt_detect_http_1.ttDetectHttp);
Cypress.Commands.add('ttElementExists', tt_element_exists_1.ttElementExists);
Cypress.Commands.add('ttEveryInternalLinkIsLoading', tt_every_internal_link_is_loading_1.ttEveryInternalLinkIsLoading);
Cypress.Commands.add('ttEveryInternalLinkStatusOk', tt_every_internal_link_status_ok_1.ttEveryInternalLinkStatusOk);
Cypress.Commands.add('ttGetInternalLinks', tt_get_internal_links_1.ttGetInternalLinks);
Cypress.Commands.add('ttInvalidPath404', tt_invalid_path_404_1.ttInvalidPath404);
Cypress.Commands.add('ttOnlyOneH1', tt_only_one_h1_1.ttOnlyOneH1);
Cypress.Commands.add('ttPageLoaded', tt_page_loaded_1.ttPageLoaded);
Cypress.Commands.add('ttSetupConsoleErrorListener', tt_setup_console_error_listener_1.ttSetupConsoleErrorListener);
Cypress.Commands.add('ttThreshold', tt_threshold_1.ttThreshold);
Cypress.Commands.add('ttValidateAllImagesResponseStatusOk', tt_validate_all_images_response_status_ok_1.ttValidateAllImagesResponseStatusOk);
Cypress.Commands.add('ttValidateImprintClickable', tt_validate_imprint_clickable_1.ttValidateImprintClickable);
Cypress.Commands.add('ttValidateLanguageTag', tt_validate_language_tag_1.ttValidateLanguageTag);
Cypress.Commands.add('ttValidateNoGoogleServices', tt_validate_no_google_services_1.ttValidateNoGoogleServices);
Cypress.Commands.add('ttValidatePageContent', tt_validate_page_content_1.ttValidatePageContent);
Cypress.Commands.add('ttValidateSubpagesAndImages', tt_validate_subpages_and_images_1.ttValidateSubpagesAndImages);
const tt_accessibility_1 = require('./commands/tt-accessibility')
const tt_click_if_element_exist_1 = require('./commands/tt-click-if-element-exist')
const tt_cookie_all_accept_1 = require('./commands/tt-cookie-all-accept')
const tt_detect_http_1 = require('./commands/tt-detect-http')
const tt_element_exists_1 = require('./commands/tt-element-exists')
const tt_every_internal_link_is_loading_1 = require('./commands/tt-every-internal-link-is-loading')
const tt_every_internal_link_status_ok_1 = require('./commands/tt-every-internal-link-status-ok')
const tt_get_internal_links_1 = require('./commands/tt-get-internal-links')
const tt_invalid_path_404_1 = require('./commands/tt-invalid-path-404')
const tt_only_one_h1_1 = require('./commands/tt-only-one-h1')
const tt_page_loaded_1 = require('./commands/tt-page-loaded')
const tt_setup_console_error_listener_1 = require('./commands/tt-setup-console-error-listener')
const tt_threshold_1 = require('./commands/tt-threshold')
const tt_validate_all_images_response_status_ok_1 = require('./commands/tt-validate-all-images-response-status-ok')
const tt_validate_imprint_clickable_1 = require('./commands/tt-validate-imprint-clickable')
const tt_validate_language_tag_1 = require('./commands/tt-validate-language-tag')
const tt_validate_no_google_services_1 = require('./commands/tt-validate-no-google-services')
const tt_validate_page_content_1 = require('./commands/tt-validate-page-content')
const tt_validate_subpages_and_images_1 = require('./commands/tt-validate-subpages-and-images')
const tt_el_1 = require('./commands/tt-el')
Cypress.Commands.add('ttEl', tt_el_1.ttEl)
Cypress.Commands.add('ttAccessibility', tt_accessibility_1.ttAccessibility)
Cypress.Commands.add(
'ttClickIfElementExist',
tt_click_if_element_exist_1.ttClickIfElementExist
)
Cypress.Commands.add(
'ttCookieAllAcceptClick',
tt_cookie_all_accept_1.ttCookieAllAcceptClick
)
Cypress.Commands.add('ttDetectHttp', tt_detect_http_1.ttDetectHttp)
Cypress.Commands.add('ttElementExists', tt_element_exists_1.ttElementExists)
Cypress.Commands.add(
'ttEveryInternalLinkIsLoading',
tt_every_internal_link_is_loading_1.ttEveryInternalLinkIsLoading
)
Cypress.Commands.add(
'ttEveryInternalLinkStatusOk',
tt_every_internal_link_status_ok_1.ttEveryInternalLinkStatusOk
)
Cypress.Commands.add(
'ttGetInternalLinks',
tt_get_internal_links_1.ttGetInternalLinks
)
Cypress.Commands.add('ttInvalidPath404', tt_invalid_path_404_1.ttInvalidPath404)
Cypress.Commands.add('ttOnlyOneH1', tt_only_one_h1_1.ttOnlyOneH1)
Cypress.Commands.add('ttPageLoaded', tt_page_loaded_1.ttPageLoaded)
Cypress.Commands.add(
'ttSetupConsoleErrorListener',
tt_setup_console_error_listener_1.ttSetupConsoleErrorListener
)
Cypress.Commands.add('ttThreshold', tt_threshold_1.ttThreshold)
Cypress.Commands.add(
'ttValidateAllImagesResponseStatusOk',
tt_validate_all_images_response_status_ok_1.ttValidateAllImagesResponseStatusOk
)
Cypress.Commands.add(
'ttValidateImprintClickable',
tt_validate_imprint_clickable_1.ttValidateImprintClickable
)
Cypress.Commands.add(
'ttValidateLanguageTag',
tt_validate_language_tag_1.ttValidateLanguageTag
)
Cypress.Commands.add(
'ttValidateNoGoogleServices',
tt_validate_no_google_services_1.ttValidateNoGoogleServices
)
Cypress.Commands.add(
'ttValidatePageContent',
tt_validate_page_content_1.ttValidatePageContent
)
Cypress.Commands.add(
'ttValidateSubpagesAndImages',
tt_validate_subpages_and_images_1.ttValidateSubpagesAndImages
)
2 changes: 1 addition & 1 deletion dist/commands/tt-accessibility.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export declare const ttAccessibility: () => void;
export declare const ttAccessibility: () => void
20 changes: 10 additions & 10 deletions dist/commands/tt-accessibility.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ttAccessibility = void 0;
'use strict'
Object.defineProperty(exports, '__esModule', { value: true })
exports.ttAccessibility = void 0
const ttAccessibility = () => {
cy.log('ttAccessibility - NCA TESTIFY');
// @ts-ignore - cypress-axe types
cy.injectAxe();
// @ts-ignore - cypress-axe types
cy.checkA11y();
};
exports.ttAccessibility = ttAccessibility;
cy.log('ttAccessibility - NCA TESTIFY')
// @ts-ignore - cypress-axe types
cy.injectAxe()
// @ts-ignore - cypress-axe types
cy.checkA11y()
}
exports.ttAccessibility = ttAccessibility
4 changes: 3 additions & 1 deletion dist/commands/tt-click-if-element-exist.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
export declare const ttClickIfElementExist: (selector: string) => Cypress.Chainable<any>;
export declare const ttClickIfElementExist: (
selector: string
) => Cypress.Chainable<any>
31 changes: 15 additions & 16 deletions dist/commands/tt-click-if-element-exist.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ttClickIfElementExist = void 0;
'use strict'
Object.defineProperty(exports, '__esModule', { value: true })
exports.ttClickIfElementExist = void 0
// src/commands/tt-click-if-element-exist.ts
const ttClickIfElementExist = (selector) => {
cy.log(`ttClickIfElementExist - Checking if element exists: ${selector}`);
return cy.get('body').then(($body) => {
if ($body.find(selector).length > 0) {
cy.log(`Element found: ${selector}. Clicking...`);
return cy.get(selector).click();
}
else {
cy.log(`Element not found: ${selector}. Skipping click.`);
return null;
}
});
};
exports.ttClickIfElementExist = ttClickIfElementExist;
cy.log(`ttClickIfElementExist - Checking if element exists: ${selector}`)
return cy.get('body').then(($body) => {
if ($body.find(selector).length > 0) {
cy.log(`Element found: ${selector}. Clicking...`)
return cy.get(selector).click()
} else {
cy.log(`Element not found: ${selector}. Skipping click.`)
return null
}
})
}
exports.ttClickIfElementExist = ttClickIfElementExist
4 changes: 3 additions & 1 deletion dist/commands/tt-cookie-all-accept.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
export declare const ttCookieAllAcceptClick: (cookieButtonStrings?: string[]) => Cypress.Chainable<any>;
export declare const ttCookieAllAcceptClick: (
cookieButtonStrings?: string[]
) => Cypress.Chainable<any>
82 changes: 45 additions & 37 deletions dist/commands/tt-cookie-all-accept.js
Original file line number Diff line number Diff line change
@@ -1,41 +1,49 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ttCookieAllAcceptClick = void 0;
const ttCookieAllAcceptClick = (cookieButtonStrings = ['alle akzeptieren', 'alles akzeptieren']) => {
cy.log('ttCookieAllAcceptClick - NCA TESTIFY');
return cy.get('body').then(($body) => {
let found = false;
for (const buttonString of cookieButtonStrings) {
if ($body.text().toLowerCase().includes(buttonString)) {
cy.log(`Found matching string: ${buttonString}`);
cy.contains(buttonString, { matchCase: false }).click({ force: true });
found = true;
break;
'use strict'
Object.defineProperty(exports, '__esModule', { value: true })
exports.ttCookieAllAcceptClick = void 0
const ttCookieAllAcceptClick = (
cookieButtonStrings = ['alle akzeptieren', 'alles akzeptieren']
) => {
cy.log('ttCookieAllAcceptClick - NCA TESTIFY')
return cy.get('body').then(($body) => {
let found = false
for (const buttonString of cookieButtonStrings) {
if ($body.text().toLowerCase().includes(buttonString)) {
cy.log(`Found matching string: ${buttonString}`)
cy.contains(buttonString, { matchCase: false }).click({ force: true })
found = true
break
}
}
if (!found) {
// Usercentrics special case
return cy.window().then((win) => {
const shadowHost = win.document.querySelector('#usercentrics-root')
if (shadowHost !== null) {
const shadowRoot = shadowHost.shadowRoot
if (shadowRoot !== null) {
const acceptButton = shadowRoot.querySelector(
'[data-testid="uc-accept-all-button"]'
)
if (acceptButton !== null) {
cy.log('Found accept button in shadow DOM, clicking...')
acceptButton.click()
found = true
}
}
}
if (!found) {
// Usercentrics special case
return cy.window().then((win) => {
const shadowHost = win.document.querySelector('#usercentrics-root');
if (shadowHost !== null) {
const shadowRoot = shadowHost.shadowRoot;
if (shadowRoot !== null) {
const acceptButton = shadowRoot.querySelector('[data-testid="uc-accept-all-button"]');
if (acceptButton !== null) {
cy.log('Found accept button in shadow DOM, clicking...');
acceptButton.click();
found = true;
}
}
}
if (!found) {
cy.log('No matching string found. Please open an issue at https://github.com/ncatestify/cypress-base-plugin/issues');
throw new Error('No matching string found. Please open an issue at https://github.com/ncatestify/cypress-base-plugin/issues');
}
return null;
});
cy.log(
'No matching string found. Please open an issue at https://github.com/ncatestify/cypress-base-plugin/issues'
)
throw new Error(
'No matching string found. Please open an issue at https://github.com/ncatestify/cypress-base-plugin/issues'
)
}
return null;
});
};
exports.ttCookieAllAcceptClick = ttCookieAllAcceptClick;
return null
})
}
return null
})
}
exports.ttCookieAllAcceptClick = ttCookieAllAcceptClick
2 changes: 1 addition & 1 deletion dist/commands/tt-detect-http.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export declare const ttDetectHttp: () => void;
export declare const ttDetectHttp: () => void
43 changes: 22 additions & 21 deletions dist/commands/tt-detect-http.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ttDetectHttp = void 0;
const chai_1 = require("chai");
'use strict'
Object.defineProperty(exports, '__esModule', { value: true })
exports.ttDetectHttp = void 0
const chai_1 = require('chai')
const ttDetectHttp = () => {
cy.log('ttDetectHttp - NCA TESTIFY');
cy.get('a').each((resultItem) => {
cy.wrap(resultItem)
.invoke('attr', 'href')
.then((href) => {
if (typeof href !== 'undefined' &&
!href.includes('mailto') &&
!href.includes('tel')) {
chai_1.assert.notInclude(href, 'http:');
}
else {
cy.log(`Filtered URL: ${href}`);
}
});
});
};
exports.ttDetectHttp = ttDetectHttp;
cy.log('ttDetectHttp - NCA TESTIFY')
cy.get('a').each((resultItem) => {
cy.wrap(resultItem)
.invoke('attr', 'href')
.then((href) => {
if (
typeof href !== 'undefined' &&
!href.includes('mailto') &&
!href.includes('tel')
) {
chai_1.assert.notInclude(href, 'http:')
} else {
cy.log(`Filtered URL: ${href}`)
}
})
})
}
exports.ttDetectHttp = ttDetectHttp
5 changes: 4 additions & 1 deletion dist/commands/tt-el.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
export declare const ttEl: (selector: string, name?: string) => Cypress.Chainable<JQuery<HTMLElement>>;
export declare const ttEl: (
selector: string,
name?: string
) => Cypress.Chainable<JQuery<HTMLElement>>
25 changes: 18 additions & 7 deletions dist/commands/tt-el.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ttEl = void 0;
'use strict'
Object.defineProperty(exports, '__esModule', { value: true })
exports.ttEl = void 0
const extractCallerName = () => {
const stack = new Error().stack
if (!stack) return null
const lines = stack.split('\n')
for (const line of lines) {
const match = line.match(/get (\w+)/)
if (match) return match[1]
}
return null
}
const ttEl = (selector, name) => {
cy.log(name || selector);
return cy.get(selector);
};
exports.ttEl = ttEl;
const logName = name || extractCallerName() || selector
cy.log(logName)
return cy.get(selector)
}
exports.ttEl = ttEl
4 changes: 3 additions & 1 deletion dist/commands/tt-element-exists.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
export declare const ttElementExists: (selector: string) => Cypress.Chainable<boolean>;
export declare const ttElementExists: (
selector: string
) => Cypress.Chainable<boolean>
Loading
Loading