You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
chore: [Multi-domain] Break out separate CI tasks to test the driver with experimentalSessionAndOrigin on (#21148)
* Attempt to run tests without the feature flag and the multi-domain folder
* do it for real this time dummy
* trying circleci changes
* valid file???
* moar changes!
* i am a master of bash scripting
* try another exclude pattern
* one more time with feeling
* lets do it again
* maybe this?
* different parallel group
* lets try this
* updating tests phase 1
* updating tests phase 2
* Apply suggestions from code review
Co-authored-by: Matt Schile <mschile@gmail.com>
* Update tests
* Run more tests
* Re-locate system test
* Flex message for firefox
Co-authored-by: Matt Schile <mschile@gmail.com>
it('throws when attempting to visit a 2nd domain on different port',function(done){
1410
1410
cy.on('fail',(err)=>{
1411
1411
const{ lastLog }=this
1412
+
constexperimentalMessage=Cypress.config('experimentalSessionAndOrigin') ? `You likely forgot to use \`cy.origin()\`:\n` : `In order to visit a different origin, you can enable the \`experimentalSessionAndOrigin\` flag and use \`cy.origin()\`:\n`
1412
1413
1413
1414
expect(err.message).to.equal(stripIndent`\
1414
1415
\`cy.visit()\` failed because you are attempting to visit a URL that is of a different origin.\n
it('throws when attempting to visit a 2nd domain on different protocol',function(done){
1442
1443
cy.on('fail',(err)=>{
1443
1444
const{ lastLog }=this
1445
+
constexperimentalMessage=Cypress.config('experimentalSessionAndOrigin') ? `You likely forgot to use \`cy.origin()\`:\n` : `In order to visit a different origin, you can enable the \`experimentalSessionAndOrigin\` flag and use \`cy.origin()\`:\n`
1444
1446
1445
1447
expect(err.message).to.equal(stripIndent`\
1446
1448
\`cy.visit()\` failed because you are attempting to visit a URL that is of a different origin.\n
it('throws when attempting to visit a 2nd domain on different superdomain',function(done){
1474
1476
cy.on('fail',(err)=>{
1475
1477
const{ lastLog }=this
1478
+
constexperimentalMessage=Cypress.config('experimentalSessionAndOrigin') ? `You likely forgot to use \`cy.origin()\`:\n` : `In order to visit a different origin, you can enable the \`experimentalSessionAndOrigin\` flag and use \`cy.origin()\`:\n`
1476
1479
1477
1480
expect(err.message).to.equal(stripIndent`\
1478
1481
\`cy.visit()\` failed because you are attempting to visit a URL that is of a different origin.\n
it('throws attempting to visit 2 unique ip addresses',function(done){
1506
1509
cy.on('fail',(err)=>{
1507
1510
const{ lastLog }=this
1511
+
constexperimentalMessage=Cypress.config('experimentalSessionAndOrigin') ? `You likely forgot to use \`cy.origin()\`:\n` : `In order to visit a different origin, you can enable the \`experimentalSessionAndOrigin\` flag and use \`cy.origin()\`:\n`
1508
1512
1509
1513
expect(err.message).to.equal(stripIndent`\
1510
1514
\`cy.visit()\` failed because you are attempting to visit a URL that is of a different origin.\n
consterror=Cypress.isBrowser('firefox') ? 'Permission denied to access property "document" on cross-origin object' : 'Blocked a frame with origin "http://localhost:3500" from accessing a cross-origin frame.'
2173
+
2174
+
// When the experimentalSessionAndOrigin feature is disabled, we will immediately and display this message.
2175
+
expect(err.message).to.equal(stripIndent`\
2176
+
Cypress detected a cross origin error happened on page load:\n
2177
+
> ${error}\n
2178
+
Before the page load, you were bound to the origin policy:\n
2179
+
> http://localhost:3500\n
2180
+
A cross origin error happens when your application navigates to a new URL which does not match the origin policy above.\n
2181
+
A new URL does not match the origin policy if the 'protocol', 'port' (if specified), and/or 'host' (unless of the same superdomain) are different.\n
2182
+
Cypress does not allow you to navigate to a different origin URL within a single test.\n
2183
+
You may need to restructure some of your test code to avoid this problem.\n
2184
+
Alternatively you can also disable Chrome Web Security in Chromium-based browsers which will turn off this restriction by setting { chromeWebSecurity: false } in \`cypress.json\`.`)
"cypress:run": "node ../../scripts/cypress run --spec \"cypress/integration/*/*\",\"cypress/integration/*/!(multi-domain)/**/*\"",
9
+
"cypress:open-experimentalSessionAndOrigin": "node ../../scripts/cypress open --config experimentalSessionAndOrigin=true",
10
+
"cypress:run-experimentalSessionAndOrigin": "node ../../scripts/cypress run --config experimentalSessionAndOrigin=true",
9
11
"postinstall": "patch-package",
10
12
"start": "node -e 'console.log(require(`chalk`).red(`\nError:\n\tRunning \\`yarn start\\` is no longer needed for driver/cypress tests.\n\tWe now automatically spawn the server in the pluginsFile.\n\tChanges to the server will be watched and reloaded automatically.`))'"
0 commit comments