Skip to content

Commit ab13a83

Browse files
committed
Merge branch 'develop' of github.com:cypress-io/cypress into astone123/ventura-webpack-permission-testing
2 parents 1b45ca8 + af21a3a commit ab13a83

File tree

17 files changed

+408
-22
lines changed

17 files changed

+408
-22
lines changed

.circleci/workflows.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ linuxArm64WorkflowFilters: &linux-arm64-workflow-filters
4646
when:
4747
or:
4848
- equal: [ develop, << pipeline.git.branch >> ]
49-
- equal: [ 'tgriesser/spike/spike', << pipeline.git.branch >> ]
49+
- equal: [ 'fix-duplicate-and-expired-cookies', << pipeline.git.branch >> ]
5050
- matches:
5151
pattern: /^release\/\d+\.\d+\.\d+$/
5252
value: << pipeline.git.branch >>
@@ -65,7 +65,7 @@ windowsWorkflowFilters: &windows-workflow-filters
6565
or:
6666
- equal: [ develop, << pipeline.git.branch >> ]
6767
# use the following branch as well to ensure that v8 snapshot cache updates are fully tested
68-
- equal: [ 'update-v8-snapshot-cache-on-develop', << pipeline.git.branch >> ]
68+
- equal: [ 'update-v8-snapshot-cache-on-develop', 'fix-duplicate-and-expired-cookies', << pipeline.git.branch >> ]
6969
- matches:
7070
pattern: /^release\/\d+\.\d+\.\d+$/
7171
value: << pipeline.git.branch >>

cli/CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,17 @@
11
<!-- See the ../guides/writing-the-cypress-changelog.md for details on writing the changelog. -->
2+
## 12.6.1
3+
4+
_Released 03/1/2023 (PENDING)_
5+
6+
**Bugfixes:**
7+
8+
- Fixed an issue where cookies were being duplicated with the same hostname, but a prepended dot. Fixed an issue where cookies may not be expiring correctly. Fixes [#25174](https://github.com/cypress-io/cypress/issues/25174), [#25205](https://github.com/cypress-io/cypress/issues/25205) and [#25495](https://github.com/cypress-io/cypress/issues/25495).
9+
- Added missing TypeScript type definitions for the [`cy.reload()`](https://docs.cypress.io/api/commands/reload) command. Addressed in [#25779](https://github.com/cypress-io/cypress/pull/25779).
10+
11+
**Misc:**
12+
13+
- Made updates to the way that the Debug Page header displays information. Addresses [#25796](https://github.com/cypress-io/cypress/issues/25796) and [#25798](https://github.com/cypress-io/cypress/issues/25798).
14+
215
## 12.6.0
316

417
_Released 02/15/2023_

cli/types/cypress.d.ts

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1816,9 +1816,21 @@ declare namespace Cypress {
18161816
*
18171817
* @see https://on.cypress.io/reload
18181818
* @example
1819+
* cy.visit('http://localhost:3000/admin')
18191820
* cy.reload()
18201821
*/
1821-
reload(options?: Partial<Loggable & Timeoutable>): Chainable<AUTWindow>
1822+
reload(): Chainable<AUTWindow>
1823+
/**
1824+
* Reload the page.
1825+
*
1826+
* @see https://on.cypress.io/reload
1827+
* @param {Partial<Loggable & Timeoutable>} options Pass in an options object to modify the default behavior of cy.reload()
1828+
* @example
1829+
* // Reload the page, do not log it in the command log and timeout after 15s
1830+
* cy.visit('http://localhost:3000/admin')
1831+
* cy.reload({log: false, timeout: 15000})
1832+
*/
1833+
reload(options: Partial<Loggable & Timeoutable>): Chainable<AUTWindow>
18221834
/**
18231835
* Reload the page without cache
18241836
*
@@ -1830,6 +1842,18 @@ declare namespace Cypress {
18301842
* cy.reload(true)
18311843
*/
18321844
reload(forceReload: boolean): Chainable<AUTWindow>
1845+
/**
1846+
* Reload the page without cache and with log and timeout options
1847+
*
1848+
* @see https://on.cypress.io/reload
1849+
* @param {Boolean} forceReload Whether to reload the current page without using the cache. true forces the reload without cache.
1850+
* @param {Partial<Loggable & Timeoutable>} options Pass in an options object to modify the default behavior of cy.reload()
1851+
* @example
1852+
* // Reload the page without using the cache, do not log it in the command log and timeout after 15s
1853+
* cy.visit('http://localhost:3000/admin')
1854+
* cy.reload(true, {log: false, timeout: 15000})
1855+
*/
1856+
reload(forceReload: boolean, options: Partial<Loggable & Timeoutable>): Chainable<AUTWindow>
18331857

18341858
/**
18351859
* Make an HTTP GET request.

packages/app/cypress/e2e/debug.cy.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ describe('App - Debug Page', () => {
7777
cy.findByTestId('debug-header-branch').contains('main')
7878
cy.findByTestId('debug-header-commitHash').contains('e9d176f')
7979
cy.findByTestId('debug-header-author').contains('Lachlan Miller')
80-
cy.findByTestId('debug-header-createdAt').contains('01:18')
80+
cy.findByTestId('debug-header-createdAt').contains('02h 00m 10s')
8181
})
8282

8383
cy.findByTestId('debug-passed').contains('Well Done!')
@@ -148,7 +148,7 @@ describe('App - Debug Page', () => {
148148
cy.findByTestId('debug-header-branch').contains('main')
149149
cy.findByTestId('debug-header-commitHash').contains('commit1')
150150
cy.findByTestId('debug-header-author').contains('Lachlan Miller')
151-
cy.findByTestId('debug-header-createdAt').contains('00:19')
151+
cy.findByTestId('debug-header-createdAt').contains('00m 19s')
152152
})
153153

154154
cy.findByTestId('spec-contents').within(() => {

packages/app/cypress/fixtures/debug-Failing/gql-Debug.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"commitInfo": {
1515
"sha": "commit1",
1616
"authorName": "Lachlan Miller",
17+
"authorEmail": "[email protected]",
1718
"summary": "chore: testing cypress",
1819
"branch": "main",
1920
"__typename": "CloudRunCommitInfo"

packages/app/cypress/fixtures/debug-Passing/gql-Debug.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,11 @@
1010
"runNumber": 2,
1111
"createdAt": "2023-01-30T08:10:59.720Z",
1212
"status": "PASSED",
13-
"totalDuration": 78898,
13+
"totalDuration": 7210000,
1414
"commitInfo": {
1515
"sha": "e9d176f0c00c0428c9945577aec37cb6d48c5a26",
1616
"authorName": "Lachlan Miller",
17+
"authorEmail": "asdf",
1718
"summary": "update projectId",
1819
"branch": "main",
1920
"__typename": "CloudRunCommitInfo"

packages/app/src/debug/DebugPageHeader.cy.tsx

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const defaults = [
66
{ attr: 'debug-header-branch', text: 'Branch Name: feature/DESIGN-183' },
77
{ attr: 'debug-header-commitHash', text: 'Commit Hash: b5e6fde' },
88
{ attr: 'debug-header-author', text: 'Commit Author: cypressDTest' },
9-
{ attr: 'debug-header-createdAt', text: 'Run Total Duration: 01:00 (an hour ago) ' },
9+
{ attr: 'debug-header-createdAt', text: 'Run Total Duration: 01m 00s (an hour ago) ' },
1010
]
1111

1212
describe('<DebugPageHeader />', {
@@ -22,6 +22,7 @@ describe('<DebugPageHeader />', {
2222
result.commitInfo.summary = 'Adding a hover state to the button component'
2323
result.commitInfo.branch = 'feature/DESIGN-183'
2424
result.commitInfo.authorName = 'cypressDTest'
25+
result.commitInfo.authorEmail = '[email protected]'
2526
result.commitInfo.sha = 'b5e6fde'
2627
}
2728
}
@@ -144,4 +145,22 @@ describe('<DebugPageHeader />', {
144145

145146
cy.findByTestId('debug-commitsAhead').should('not.exist')
146147
})
148+
149+
it('renders duration over 1 hour', () => {
150+
cy.mountFragment(DebugPageHeaderFragmentDoc, {
151+
onResult (result) {
152+
if (result) {
153+
result.totalDuration = 3602000000
154+
}
155+
},
156+
render: (gqlVal) => {
157+
return (
158+
<DebugPageHeader gql={gqlVal} commitsAhead={0}/>
159+
)
160+
},
161+
})
162+
163+
cy.findByTestId('debug-header-createdAt')
164+
.should('have.text', 'Run Total Duration: 16h 33m 20s (an hour ago) ')
165+
})
147166
})

packages/app/src/debug/DebugPageHeader.vue

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,9 @@
8181
v-if="debug?.commitInfo?.authorName"
8282
data-cy="debug-header-author"
8383
>
84-
<i-cy-general-user_x16
85-
class="mr-1 mr-11px icon-dark-gray-500 icon-light-gray-100 icon-secondary-light-gray-200"
84+
<UserAvatar
85+
class="h-16px mr-8px w-16px"
86+
:email="debug?.commitInfo?.authorEmail"
8687
data-cy="debug-header-avatar"
8788
/>
8889
<span class="sr-only">Commit Author:</span> {{ debug.commitInfo.authorName }}
@@ -113,8 +114,8 @@ import CommitIcon from '~icons/cy/commit_x14'
113114
import { gql } from '@urql/core'
114115
import { dayjs } from '../runs/utils/day.js'
115116
import { useI18n } from 'vue-i18n'
116-
import { useDurationFormat } from '../composables/useDurationFormat'
117117
import DebugRunNumber from './DebugRunNumber.vue'
118+
import UserAvatar from '@cy/gql-components/topnav/UserAvatar.vue'
118119
119120
const { t } = useI18n()
120121
@@ -132,6 +133,7 @@ fragment DebugPageHeader on CloudRun {
132133
...RunResults
133134
commitInfo {
134135
authorName
136+
authorEmail
135137
summary
136138
branch
137139
}
@@ -147,7 +149,14 @@ const debug = computed(() => props.gql)
147149
148150
const relativeCreatedAt = computed(() => dayjs(new Date(debug.value.createdAt!)).fromNow())
149151
150-
const totalDuration = useDurationFormat(debug.value.totalDuration ?? 0)
152+
/*
153+
Format duration to in HH[h] mm[m] ss[s] format. The `totalDuration` field is milliseconds. Remove the leading "00h" if the value is less
154+
than an hour. Currently, there is no expectation that a run duration will be greater 24 hours or greater, so it is okay that
155+
this format would "roll-over" in that scenario.
156+
Ex: 1 second which is 1000ms = 00m 01s
157+
Ex: 1 hour and 1 second which is 3601000ms = 01h 00m 01s
158+
*/
159+
const totalDuration = computed(() => dayjs.duration(debug.value.totalDuration ?? 0).format('HH[h] mm[m] ss[s]').replace(/^0+h /, ''))
151160
152161
</script>
153162
<style scoped>

packages/driver/cypress/e2e/e2e/origin/cookie_login.cy.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -723,7 +723,7 @@ describe('cy.origin - cookie login', { browser: '!webkit' }, () => {
723723

724724
cy.getCookie('key').then((cookie) => {
725725
expect(Cypress._.omit(cookie, 'expiry')).to.deep.equal({
726-
domain: '.www.foobar.com',
726+
domain: 'www.foobar.com',
727727
httpOnly: false,
728728
name: 'key',
729729
path: '/fixtures',
@@ -851,7 +851,7 @@ describe('cy.origin - cookie login', { browser: '!webkit' }, () => {
851851
cy.get('[data-cy="doc-cookie"]').invoke('text').should('equal', 'name=value')
852852
cy.getCookie('name').then((cookie) => {
853853
expect(Cypress._.omit(cookie, 'expiry')).to.deep.equal({
854-
domain: '.www.foobar.com',
854+
domain: 'www.foobar.com',
855855
httpOnly: false,
856856
name: 'name',
857857
path: '/',

0 commit comments

Comments
 (0)