Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump json5 and testcafe #10

Closed
Closed
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
2 changes: 1 addition & 1 deletion V2/tests/Cart-Page.testcafe.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ for (const screenName in screens) {
await t.navigateTo('/cart');

await t
.typeText(Selector("input[aria-label=Name]"), "John", {replace: true})
.typeText(Selector("input[aria-label='Full Name']"), "John", {replace: true})
.pressKey("Enter");

await checkElementScreenshot(`Cart-Page--${screenName}.png`, TopBar, t);
Expand Down
Binary file modified V2/tests/etalons/Cart-Page--CountryDropdown--Desktop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified V2/tests/etalons/Cart-Page--CountryDropdown--Large-Desktop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified V2/tests/etalons/Cart-Page--CountryDropdown--Mobile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified V2/tests/etalons/Cart-Page--CountryDropdown--Tablet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified V2/tests/etalons/Cart-Page--CountryDropdown--Vertical-Tablet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified V2/tests/etalons/Cart-Page--Desktop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified V2/tests/etalons/Cart-Page--Empty--Desktop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified V2/tests/etalons/Cart-Page--Empty--Large-Desktop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified V2/tests/etalons/Cart-Page--Empty--Mobile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified V2/tests/etalons/Cart-Page--Empty--Tablet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified V2/tests/etalons/Cart-Page--Empty--Vertical-Tablet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified V2/tests/etalons/Cart-Page--Large-Desktop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified V2/tests/etalons/Cart-Page--Mobile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified V2/tests/etalons/Cart-Page--QtyDropdown--Desktop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified V2/tests/etalons/Cart-Page--QtyDropdown--Large-Desktop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified V2/tests/etalons/Cart-Page--QtyDropdown--Mobile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified V2/tests/etalons/Cart-Page--QtyDropdown--Tablet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified V2/tests/etalons/Cart-Page--QtyDropdown--Vertical-Tablet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified V2/tests/etalons/Cart-Page--Tablet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified V2/tests/etalons/Cart-Page--Vertical-Tablet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified V2/tests/etalons/Documentation-Page--Large-Desktop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified V2/tests/etalons/Licensing-Page--Desktop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified V2/tests/etalons/Licensing-Page--Large-Desktop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified V2/tests/etalons/Licensing-Page--Mobile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified V2/tests/etalons/Licensing-Page--Tablet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified V2/tests/etalons/Licensing-Page--Vertical-Tablet.png
Binary file modified V2/tests/etalons/Pricing-Page--Desktop.png
Binary file modified V2/tests/etalons/Pricing-Page--Large-Desktop.png
Binary file modified V2/tests/etalons/Pricing-Page--Mobile.png
Binary file modified V2/tests/etalons/Pricing-Page--Tablet.png
Binary file modified V2/tests/etalons/Pricing-Page--Vertical-Tablet.png
Binary file modified V2/tests/etalons/Support-Page--Mobile.png
Binary file modified V2/tests/etalons/Support-Page--Tablet.png
Binary file modified V2/tests/etalons/Support-Page--Vertical-Tablet.png
4,405 changes: 1,031 additions & 3,374 deletions package-lock.json

Large diffs are not rendered by default.

9 changes: 4 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@
"name": "surveyjs.io.tests",
"scripts": {
"test:test": "testcafe chrome surveyjstest/Library/Examples/question_types.testcafe.js -t \"signaturepad\" --selector-timeout 1500",
"test": "npm run test:pay && npm run test:all",
"test:all": "testcafe chrome surveyjstest --selector-timeout 5000",
"test": "testcafe chrome surveyjstest --selector-timeout 5000",
"test:pay": "testcafe -e chrome payment --selector-timeout 5000",
"test:file": "testcafe chrome surveyjstest/Common/cart.testcafe.js --selector-timeout 1500",
"test_ci": "npm run test_ci:pay && npm run test_ci:all",
"test_ci": "npm run test_ci:all",
"test_ci:all": "testcafe chrome:headless surveyjstest --selector-timeout 1500 --reporter spec,xunit:report.xml --browser-init-timeout 420000 --page-request-timeout 168000",
"test_ci:pay": "testcafe -e chrome:headless payment --selector-timeout 5000 --reporter spec,xunit:report.xml --browser-init-timeout 420000 --page-request-timeout 168000",
"test_ci:pay": "testcafe -e chrome:headless payment -s takeOnFails=true --selector-timeout 5000 --reporter spec,xunit:report.xml --browser-init-timeout 420000 --page-request-timeout 168000",
"v2:ci": "testcafe chrome:headless ./V2/ --screenshots ./ --selector-timeout 1500 --reporter spec,xunit:report.xml --browser-init-timeout 420000 --page-request-timeout 168000",
"v2:ci:new": "testcafe chrome:headless ./V2/ --screenshots ./ --selector-timeout 1500 --reporter spec,xunit:report.xml --browser-init-timeout 420000 --page-request-timeout 168000 --env-new=true",
"v2:dev": "testcafe chrome ./V2/ --screenshots ./ --selector-timeout 1500 --reporter spec,xunit:report.xml --browser-init-timeout 420000 --page-request-timeout 168000 --env-dev=true",
Expand All @@ -19,7 +18,7 @@
"dependencies": {
"devextreme-screenshot-comparer": "^2.0.14",
"minimist": "^1.2.6",
"testcafe": "^1.20.1",
"testcafe": "^15.1.317922",
"testcafe-reporter-xunit": "^2.2.1"
}
}
43 changes: 33 additions & 10 deletions payment/Common/cart.testcafe.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,38 @@ test('Full buy cart cycle', async t => {


await t.click(Selector("button").withText("Proceed to Checkout"));
const iframeSelector = Selector('#sjs-pyapal-payment iframe', { timeout: 30000 });
await t.switchToIframe(iframeSelector);
await t.click(Selector("div.paypal-button[aria-label='PayPal']"), {timeout: 30000});

await t.click(Selector("button").withText("Log In"));
await t.typeText(Selector("#email"), "[email protected]");
await t.click(Selector("button").withText("Next"));
await t.typeText(Selector("#password"), "[email protected]");
await t.click(Selector("button").withText("Log In"));
await t.click(Selector("button").withText("Complete Purchase"));
const iframeSelector = Selector('#sjs-pyapal-payment iframe');
await t.switchToIframe(iframeSelector, { timeout: 30000 });
// await t.click(Selector("div.paypal-button[aria-label='PayPal']"), {timeout: 30000});

// await t.click(Selector("button").withText("Log In"));
// await t.typeText(Selector("#email"), "[email protected]");
// await t.click(Selector("button").withText("Next"));
// await t.typeText(Selector("#password"), "[email protected]");
// await t.click(Selector("button").withText("Log In"));
// await t.click(Selector("button").withText("Complete Purchase"));

await t.click(Selector("div.paypal-button[aria-label='Debit or Credit Card']"), {timeout: 30000});
const iframeSelectorCard = Selector('#card-fields-container iframe');
await t.expect(iframeSelectorCard.exists, { timeout: 30000 }).ok();
await t.switchToIframe(iframeSelectorCard);

await t.typeText(Selector("input[name=cardnumber]"), "4005519200000004");
await t.typeText(Selector("input[name='expiry-date']"), "0125");
await t.typeText(Selector("input[name='credit-card-security']"), "123");

await t.typeText(Selector("input[name=givenName]"), "Tester");
await t.typeText(Selector("input[name=familyName]"), "Name");
await t.typeText(Selector("input[name=line1]"), "Test address");
await t.typeText(Selector("input[name=city]"), "Test city");
await t.click(Selector("select[name=state]"));
await t.click(Selector("select[name=state] option").withText('Alabama'));
await t.typeText(Selector("input[name=postcode]"), "35004");
await t.typeText(Selector("input[name=phone]"), "5555555555");
await t.typeText(Selector("input[name=email]"), "[email protected]");

await t.click(Selector("button").withText("Pay Now"));
await t.switchToMainWindow();

await t.expect(Selector("body").innerText).eql("OK", "ok", {timeout: 30000});
});