hammerhead.js __get$(document, "location").ancestorOrigins returns <unreadable>
See original GitHub issueWhat is your Scenario?
Fuse Microform iframes should be shown in given div containers. See this doc: https://developer.cybersource.com/docs/cybs/en-us/digital-accept-flex/developer/all/rest/digital-accept-flex/microform-integ/microform-integ-getting-started/setting-up-client-side.html
What is the Current behavior?
When I test it manually all works fine, when I run the test script I get the issue that __get$(document, "location").ancestorOrigins
returns value unreadable as per screenshot below
What is the Expected behavior?
__get$(document, "location").ancestorOrigins
returns ‘http://localhost:12345’
What is your public website URL? (or attach your complete example)
https://flex-microform-hammerhead-issue.azurewebsites.net/
What is your TestCafe test code?
import { Selector } from 'testcafe';
fixture('Azure')
.page('about:blank');
test('Azure', async t => {
await t
.maximizeWindow()
.navigateTo('https://flex-microform-hammerhead-issue.azurewebsites.net/');
var mainWindow = await t.getCurrentWindow()
try {
await t
.typeText('#cardholderName', 'Tester')
.wait(1000);
await t.debug();
await t
.switchToIframe('#number-container > iframe')
.typeText('[name="number"]', '4111111111111111')
.switchToWindow(mainWindow);
await t
.switchToIframe(`#securityCode-container > iframe`)
.typeText('[name="securityCode"]', '123')
.switchToWindow(mainWindow);
await t
.click('#pay-button');
await t
.wait(1000)
.click('#pay-button');
} catch (ex) {
console.error(ex);
}
await t.debug();
});
Your complete configuration file
.testcaferc.json
{ "skipJsErrors": true, "hostname": "localhost", "port1": 12345, "port2": 12346 }
Your complete test report
No response
Screenshots
Steps to Reproduce
- Run automated script in chrome
- When script stops open dev tools
- Switch to Console
- Unclock the page and press
Mount Security Code
button - Expected error should be
correlationId: undefined
details: undefined
informationLink: "https://www.cybersource.com/products/payment_security/secure_acceptance"
message: "You have not supplied a valid capture context."
name: "MicroformError"
reason: "CAPTURE_CONTEXT_INVALID"
- Open iframe.min.js and format it it so that it’s not minified, add breakpoint in line 2772 as per screenshot below
- Press
Mount Security Code
button again and in debug inspectdocument
and__get$(document, "location")
variables
TestCafe version
1.18.6
Node.js version
v14.17.6
Command-line arguments
testcafe chrome azure.js
Browser name(s) and version(s)
Chrome 101.0.4951.54 / Windows 10
Platform(s) and version(s)
Windows
Other
No response
Issue Analytics
- State:
- Created a year ago
- Comments:8
Top GitHub Comments
We will research this issue and update this thread as soon as we have any news.
Release v2.1.0-rc.1 addresses this.