Skip to content

Commit

Permalink
fix path to helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
OlgaLarina committed Nov 8, 2023
1 parent 1a5802c commit affeb9e
Show file tree
Hide file tree
Showing 14 changed files with 42 additions and 13 deletions.
2 changes: 1 addition & 1 deletion examples/Creator/ck_editor.testcafe.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Selector, fixture, test } from 'testcafe';
import { getIUnderstandButton } from '../surveyjstest/helpers';
import { getIUnderstandButton } from '../helpers';

fixture `ck_editor`
.page `https://surveyjstest.azurewebsites.net/Examples/Builder?id=ckeditorpropertyeditor&theme=default`;
Expand Down
2 changes: 1 addition & 1 deletion examples/Creator/custom_matrix_cell_types.testcafe.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Selector, fixture, test } from 'testcafe';
import { getIUnderstandButton } from '../surveyjstest/helpers';
import { getIUnderstandButton } from '../helpers';

fixture `custom_matrix_cell_types`
.page `https://surveyjstest.azurewebsites.net/Examples/Builder?id=matrixcustomcelltypes&theme=default`;
Expand Down
2 changes: 1 addition & 1 deletion examples/Creator/custom_widgets.testcafe.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Selector, fixture, test } from 'testcafe';
import { acceptCookie, getExampleTabSelector } from '../surveyjstest/helpers';
import { acceptCookie, getExampleTabSelector } from '../helpers';

fixture`custom_widgets`
.page`https://surveyjstest.azurewebsites.net/Examples/Builder?id=customwidgets&platform=reactjs`.beforeEach(async t => {
Expand Down
2 changes: 1 addition & 1 deletion examples/Creator/depends_on_properties.testcafe.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Selector, fixture, test } from 'testcafe';
import { getExampleTabSelector, acceptCookie } from '../surveyjstest/helpers';
import { getExampleTabSelector, acceptCookie } from '../helpers';

fixture `depends_on_properties`
.page `https://surveyjstest.azurewebsites.net/Examples/Builder?id=dependsonproperties&platform=Knockoutjs&theme=default`.beforeEach(async t => {
Expand Down
2 changes: 1 addition & 1 deletion examples/Creator/element_menu_customization.testcafe.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Selector, fixture, test } from 'testcafe';
import { acceptCookie, getExampleTabSelector } from '../surveyjstest/helpers';
import { acceptCookie, getExampleTabSelector } from '../helpers';

fixture`element_menu_customization`
.page`https://surveyjstest.azurewebsites.net/Examples/Builder?id=elementmenu&platform=Knockoutjs&theme=default`.beforeEach(async t => {
Expand Down
2 changes: 1 addition & 1 deletion examples/Creator/localization.testcafe.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Selector, fixture, test } from 'testcafe';
import { acceptCookie, explicitErrorHandler, getExampleTabSelector } from '../surveyjstest/helpers';
import { acceptCookie, explicitErrorHandler, getExampleTabSelector } from '../helpers';

fixture `localization`
.page `https://surveyjstest.azurewebsites.net/survey-creator/examples/survey-creator-interface-localization/knockoutjs`
Expand Down
2 changes: 1 addition & 1 deletion examples/Creator/modify_new_question.testcafe.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Selector, fixture, test } from 'testcafe';
import { acceptCookie, getExampleTabSelector } from '../surveyjstest/helpers';
import { acceptCookie, getExampleTabSelector } from '../helpers';

fixture`modify_new_question`
.page`https://surveyjstest.azurewebsites.net/Examples/Builder?id=oncreatequestion&platform=Knockoutjs&theme=default`.beforeEach(async t => {
Expand Down
2 changes: 1 addition & 1 deletion examples/Creator/toolbox_customization.testcafe.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Selector, fixture, test } from 'testcafe';
import { acceptCookie, getExampleTabSelector } from '../surveyjstest/helpers';
import { acceptCookie, getExampleTabSelector } from '../helpers';

fixture`toolbox_customization`
.page`https://surveyjstest.azurewebsites.net/Examples/Builder?id=toolboxcustomization&platform=Knockoutjs&theme=default`.beforeEach(async t => {
Expand Down
2 changes: 1 addition & 1 deletion examples/Library/codesandboxcheck.testcafe.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Selector, fixture, test } from 'testcafe';
import { explicitErrorHandler } from '../../../surveyjstest/helpers';
import { explicitErrorHandler } from '../helpers';

fixture`question_types`
.page`https://surveyjstest.azurewebsites.net/form-library/examples/text-entry-question/reactjs`.clientScripts({
Expand Down
2 changes: 1 addition & 1 deletion examples/Library/question_types.testcafe.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Selector, fixture, test } from 'testcafe';
import { explicitErrorHandler, getSideBarGroupItem, getSideBarItem } from '../../helpers';
import { explicitErrorHandler, getSideBarGroupItem, getSideBarItem } from '../helpers';

fixture `question_types`.page `https://surveyjstest.azurewebsites.net/Examples/Library`.clientScripts({
content: `(${explicitErrorHandler.toString()})()`
Expand Down
2 changes: 1 addition & 1 deletion examples/Library/survey.testcafe.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Selector, fixture, test } from 'testcafe';
import { getSideBarGroupItem, getSideBarItem, explicitErrorHandler, acceptCookie } from '../../helpers';
import { getSideBarGroupItem, getSideBarItem, explicitErrorHandler, acceptCookie } from '../helpers';

fixture`survey`
.page`https://surveyjstest.azurewebsites.net/Examples/Library`.clientScripts({
Expand Down
2 changes: 1 addition & 1 deletion examples/Library/tabs.testcafe.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Selector, fixture, test } from 'testcafe';
import { getIUnderstandButton, getExampleTabSelector, acceptCookie } from '../../../surveyjstest/helpers';
import { getIUnderstandButton, getExampleTabSelector, acceptCookie } from '../helpers';

fixture `tabs`
.page `https://surveyjstest.azurewebsites.net/Examples/Library?id=questiontype-radiogroup&platform=jQuery&theme=default`
Expand Down
28 changes: 28 additions & 0 deletions examples/helpers.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { Selector, fixture, test } from 'testcafe';

export function getSideBarGroupItem(text) {
return Selector('.v2-class---drop-down-menu-item__link--level-1').withText(text);
}
export function getSideBarItem(text) {
return Selector('.v2-class---drop-down-menu-item__link--level-2').withText(text);
}
export function getExampleTabSelector(text) {
return Selector('.v2-class---footer-toolbar-item').filterVisible().withText(text);
}
export const explicitErrorHandler = () => { window.addEventListener('error', e => {
if (e.message === 'ResizeObserver loop completed with undelivered notifications.' ||
e.message === 'ResizeObserver loop limit exceeded') {
e.stopImmediatePropagation();
} });
};

export function getIUnderstandButton() {
return Selector('span').withText('Accept All');
}

export async function acceptCookie(t) {
const cookiePopupAccept = Selector('.v2-class---banner-footer-actions .v2-class---button');
if(await cookiePopupAccept.exists) {
await t.click(cookiePopupAccept); // close cookie msg
}
}
3 changes: 2 additions & 1 deletion surveyjstest/ExamplesCheck/examplescheck.testcafe.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit affeb9e

Please sign in to comment.