mirror of
https://github.com/cypress-io/cypress.git
synced 2026-01-30 19:18:45 -06:00
more
This commit is contained in:
@@ -328,7 +328,7 @@ describe('runner/cypress sessions.ui.spec', {
|
||||
})
|
||||
})
|
||||
|
||||
describe('runner/cypress sessions.open_mode.spec', () => {
|
||||
describe.only('runner/cypress sessions.open_mode.spec', () => {
|
||||
beforeEach(() => {
|
||||
cy.scaffoldProject('session-and-origin-e2e-specs')
|
||||
cy.openProject('session-and-origin-e2e-specs')
|
||||
@@ -340,38 +340,47 @@ describe('runner/cypress sessions.open_mode.spec', () => {
|
||||
passCount: 1,
|
||||
})
|
||||
|
||||
cy.get('.command-name-session').should('contain', 'user1')
|
||||
cy.get('.command-name-session').should('contain', 'spec_session_1')
|
||||
.find('.reporter-tag').should('contain', 'created')
|
||||
|
||||
cy.get('.command-name-session').should('contain', 'user2')
|
||||
cy.get('.command-name-session').should('contain', 'spec_session_2')
|
||||
.find('.reporter-tag').should('contain', 'created')
|
||||
|
||||
cy.get('.command-name-session').should('contain', 'global_session_1')
|
||||
.find('.reporter-tag').should('contain', 'created')
|
||||
})
|
||||
|
||||
it('persists spec sessions when clicking "rerun all tests" button', () => {
|
||||
it('persists global and spec sessions when clicking "rerun all tests" button', () => {
|
||||
cy.get('.restart').click()
|
||||
|
||||
cy.waitForSpecToFinish({
|
||||
passCount: 1,
|
||||
})
|
||||
|
||||
cy.get('.command-name-session').should('contain', 'user1')
|
||||
cy.get('.command-name-session').should('contain', 'spec_session_1')
|
||||
.find('.reporter-tag').should('contain', 'restored')
|
||||
|
||||
cy.get('.command-name-session').should('contain', 'user2')
|
||||
cy.get('.command-name-session').should('contain', 'spec_session_2')
|
||||
.find('.reporter-tag').should('contain', 'restored')
|
||||
|
||||
cy.get('.command-name-session').should('contain', 'global_session_1')
|
||||
.find('.reporter-tag').should('contain', 'restored')
|
||||
})
|
||||
|
||||
it('persists spec sessions on refresh', () => {
|
||||
it('persists global and spec sessions on refresh', () => {
|
||||
cy.get('body').type('r')
|
||||
|
||||
cy.waitForSpecToFinish({
|
||||
passCount: 1,
|
||||
})
|
||||
|
||||
cy.get('.command-name-session').should('contain', 'user1')
|
||||
cy.get('.command-name-session').should('contain', 'spec_session_1')
|
||||
.find('.reporter-tag').should('contain', 'restored')
|
||||
|
||||
cy.get('.command-name-session').should('contain', 'user2')
|
||||
cy.get('.command-name-session').should('contain', 'spec_session_2')
|
||||
.find('.reporter-tag').should('contain', 'restored')
|
||||
|
||||
cy.get('.command-name-session').should('contain', 'global_session_1')
|
||||
.find('.reporter-tag').should('contain', 'restored')
|
||||
})
|
||||
|
||||
@@ -385,5 +394,35 @@ describe('runner/cypress sessions.open_mode.spec', () => {
|
||||
|
||||
cy.get('.command-name-session').should('contain', 'user1')
|
||||
.find('.reporter-tag').should('contain', 'created')
|
||||
|
||||
cy.get('.command-name-session').should('contain', 'user1')
|
||||
.find('.reporter-tag').should('contain', 'created')
|
||||
})
|
||||
|
||||
it('clears all sessions when selecting "clear all sessions"', () => {
|
||||
cy.get('body').type('f')
|
||||
cy.get('div[title="new_session.cy.js"]').click()
|
||||
|
||||
cy.waitForSpecToFinish({
|
||||
passCount: 1,
|
||||
})
|
||||
|
||||
cy.get('.command-name-session').should('contain', 'user1')
|
||||
.find('.reporter-tag').should('contain', 'created')
|
||||
})
|
||||
|
||||
it('persists global sessions when selecting a different spec', () => {
|
||||
cy.get('body').type('f')
|
||||
cy.get('div[title="blank_session.cy.js"]').click()
|
||||
|
||||
cy.waitForSpecToFinish({
|
||||
passCount: 1,
|
||||
})
|
||||
|
||||
cy.get('.command-name-session').should('contain', 'spec_session')
|
||||
.find('.reporter-tag').should('contain', 'created')
|
||||
|
||||
cy.get('.command-name-session').should('contain', 'global_session_1')
|
||||
.find('.reporter-tag').should('contain', 'restored')
|
||||
})
|
||||
})
|
||||
|
||||
@@ -203,7 +203,7 @@ export default class SessionsManager {
|
||||
return this.Cypress.automation('clear:cookies', await this.sessions.getCookies())
|
||||
},
|
||||
|
||||
getCurrentSessionData: async (): Pick<SessionData, 'localStorage', 'sess' => {
|
||||
getCurrentSessionData: async () => {
|
||||
const [storage, cookies] = await Promise.all([
|
||||
this.sessions.getStorage({ origin: '*' }),
|
||||
this.sessions.getCookies(),
|
||||
|
||||
@@ -668,7 +668,7 @@ class $Cypress {
|
||||
return this.emit('page:loading', args[0])
|
||||
|
||||
case 'app:window:before:load':
|
||||
this.cy.onBeforeAppWindowLoad(args[0])
|
||||
this.cy?.onBeforeAppWindowLoad(args[0])
|
||||
|
||||
return this.emit('window:before:load', args[0])
|
||||
|
||||
|
||||
@@ -312,8 +312,6 @@ export class Http {
|
||||
}
|
||||
|
||||
getRenderedHTMLOrigins = () => {
|
||||
console.log('renderedHTMLOrigins', this.renderedHTMLOrigins)
|
||||
|
||||
return this.renderedHTMLOrigins
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@cypress-design/react-icon": "0.4.2",
|
||||
"@cypress-design/react-statusicon": "0.0.2",
|
||||
"@cypress/react-tooltip": "0.5.3",
|
||||
"@fontsource/mulish": "4.3.0",
|
||||
"@fontsource/open-sans": "4.3.0",
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>{{title}}</title>
|
||||
</head>
|
||||
<body>
|
||||
<script type="text/javascript">
|
||||
document.domain = '{{domain}}';
|
||||
</script>
|
||||
<script src="/__cypress/runner/cypress_cross_origin_runner.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -322,8 +322,6 @@ const renderSummaryTable = (runUrl) => {
|
||||
return function (results) {
|
||||
const { runs } = results
|
||||
|
||||
console.log('runs', runs)
|
||||
|
||||
console.log('')
|
||||
|
||||
terminal.divider('=')
|
||||
|
||||
@@ -99,7 +99,7 @@ export class SocketBase {
|
||||
// instead of throwing immediately here perhaps we need
|
||||
// to make this more resilient by automatically retrying
|
||||
// up to 1 second in the case where our automation room
|
||||
// is empty. that would give padding for reconnection s
|
||||
// is empty. that would give padding for reconnections
|
||||
// to automatically happen.
|
||||
// for instance when socket.io detects a disconnect
|
||||
// does it immediately remove the member from the room?
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
it('t1', () => {
|
||||
cy.session('blank_session', () => {})
|
||||
assert(true)
|
||||
cy.session('spec_session', () => {})
|
||||
|
||||
cy.session('global_session_1', () => {
|
||||
window.localStorage.foo = 'val'
|
||||
}, {
|
||||
cacheAcrossSpecs: true,
|
||||
})
|
||||
})
|
||||
|
||||
@@ -1,10 +1,18 @@
|
||||
it('t1', () => {
|
||||
cy.session('user1', () => {
|
||||
cy.session('spec_session_1', () => {
|
||||
window.localStorage.foo = 'val'
|
||||
})
|
||||
|
||||
cy.session('user2', () => {
|
||||
cy.session('spec_session_2', () => {
|
||||
window.localStorage.foo = 'val'
|
||||
window.localStorage.bar = 'val'
|
||||
}, {
|
||||
cacheAcrossSpecs: true,
|
||||
})
|
||||
|
||||
cy.session('global_session_1', () => {
|
||||
window.localStorage.foo = 'val'
|
||||
}, {
|
||||
cacheAcrossSpecs: true,
|
||||
})
|
||||
})
|
||||
|
||||
18
yarn.lock
18
yarn.lock
@@ -2344,27 +2344,18 @@
|
||||
dependencies:
|
||||
camelcase "^6.3.0"
|
||||
|
||||
"@cypress-design/icon-registry@^0.6.0", "@cypress-design/icon-registry@^0.6.1":
|
||||
"@cypress-design/icon-registry@^0.6.1":
|
||||
version "0.6.1"
|
||||
resolved "https://registry.yarnpkg.com/@cypress-design/icon-registry/-/icon-registry-0.6.1.tgz#a834e6a53fb5bb437876ce9e2ee10e89950da053"
|
||||
integrity sha512-5fNKHzXz02MDNhZBfa0ddk5Rzb071jDXTBDRZOmRTojsEftW3mERuOAUOwtcuE/KG0ZdO5swpM17WOo9HO1klw==
|
||||
|
||||
"@cypress-design/react-icon@0.4.2", "@cypress-design/react-icon@^0.4.1":
|
||||
"@cypress-design/react-icon@0.4.2":
|
||||
version "0.4.2"
|
||||
resolved "https://registry.yarnpkg.com/@cypress-design/react-icon/-/react-icon-0.4.2.tgz#bc76938fafdfbced55680fc24d2e8efd8c33e481"
|
||||
integrity sha512-qjT2o9eK+0cgwX2WuFdmKLysVS90KGfvCHjt2iGDX7p5Pnc/+WD3JvCpGRtHn894noL5wbynsD75SbO3u2rtZQ==
|
||||
dependencies:
|
||||
"@cypress-design/icon-registry" "^0.6.1"
|
||||
|
||||
"@cypress-design/react-statusicon@0.0.2":
|
||||
version "0.0.2"
|
||||
resolved "https://registry.yarnpkg.com/@cypress-design/react-statusicon/-/react-statusicon-0.0.2.tgz#eed79b9ae6c7abd1a10f2f104ef36954ffd25562"
|
||||
integrity sha512-phkRENIg0u7FoLH5ljiYOWUIz1CH3YWcjeRfMk3Bbg5cIFujUdPSjf/vmyofeeiyWvvLN04M7gVtHOWksf+0kg==
|
||||
dependencies:
|
||||
"@cypress-design/icon-registry" "^0.6.0"
|
||||
"@cypress-design/react-icon" "^0.4.1"
|
||||
clsx "*"
|
||||
|
||||
"@cypress-design/vue-icon@^0.4.2":
|
||||
version "0.4.2"
|
||||
resolved "https://registry.yarnpkg.com/@cypress-design/vue-icon/-/vue-icon-0.4.2.tgz#3574a749efbdaf83f48251108c016c3d383160bd"
|
||||
@@ -12224,11 +12215,6 @@ cloneable-readable@^1.0.0:
|
||||
process-nextick-args "^2.0.0"
|
||||
readable-stream "^2.3.5"
|
||||
|
||||
clsx@*:
|
||||
version "1.2.1"
|
||||
resolved "https://registry.yarnpkg.com/clsx/-/clsx-1.2.1.tgz#0ddc4a20a549b59c93a4116bb26f5294ca17dc12"
|
||||
integrity sha512-EcR6r5a8bj6pu3ycsa/E/cKVGuTgZJZdsyUYHOksG/UHIiKfjxzRxYJpyVBwYaQeOvghal9fcc4PidlgzugAQg==
|
||||
|
||||
cmd-shim@^5.0.0:
|
||||
version "5.0.0"
|
||||
resolved "https://registry.yarnpkg.com/cmd-shim/-/cmd-shim-5.0.0.tgz#8d0aaa1a6b0708630694c4dbde070ed94c707724"
|
||||
|
||||
Reference in New Issue
Block a user