Skip to content

Commit

Permalink
Merge branch 'feature/ct-public-api' of https://github.com/cypress-io…
Browse files Browse the repository at this point in the history
…/cypress into feature/ct-public-api
  • Loading branch information
lmiller1990 committed Feb 17, 2023
2 parents 9b796c8 + 1552adf commit a6a71e1
Show file tree
Hide file tree
Showing 17 changed files with 410 additions and 21 deletions.
5 changes: 4 additions & 1 deletion .circleci/workflows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ mainBuildFilters: &mainBuildFilters
# use the following branch as well to ensure that v8 snapshot cache updates are fully tested
- 'update-v8-snapshot-cache-on-develop'
- 'tgriesser/spike/spike'
- 'fix-duplicate-and-expired-cookies'

# usually we don't build Mac app - it takes a long time
# but sometimes we want to really confirm we are doing the right thing
Expand All @@ -43,6 +44,7 @@ macWorkflowFilters: &darwin-workflow-filters
- equal: [ 'feature/ct-public-api', << pipeline.git.branch >> ]
- equal: [ 'update-v8-snapshot-cache-on-develop', << pipeline.git.branch >> ]
- equal: [ 'tgriesser/spike/spike', << pipeline.git.branch >> ]
- equal: [ 'fix-duplicate-and-expired-cookies', << pipeline.git.branch >> ]
- matches:
pattern: /^release\/\d+\.\d+\.\d+$/
value: << pipeline.git.branch >>
Expand All @@ -55,6 +57,7 @@ linuxArm64WorkflowFilters: &linux-arm64-workflow-filters
# use the following branch as well to ensure that v8 snapshot cache updates are fully tested
- equal: [ 'update-v8-snapshot-cache-on-develop', << pipeline.git.branch >> ]
- equal: [ 'tgriesser/spike/spike', << pipeline.git.branch >> ]
- equal: [ 'fix-duplicate-and-expired-cookies', << pipeline.git.branch >> ]
- matches:
pattern: /^release\/\d+\.\d+\.\d+$/
value: << pipeline.git.branch >>
Expand All @@ -73,7 +76,7 @@ windowsWorkflowFilters: &windows-workflow-filters
or:
- equal: [ develop, << pipeline.git.branch >> ]
# use the following branch as well to ensure that v8 snapshot cache updates are fully tested
- equal: [ 'update-v8-snapshot-cache-on-develop', << pipeline.git.branch >> ]
- equal: [ 'update-v8-snapshot-cache-on-develop', 'fix-duplicate-and-expired-cookies', << pipeline.git.branch >> ]
- matches:
pattern: /^release\/\d+\.\d+\.\d+$/
value: << pipeline.git.branch >>
Expand Down
13 changes: 13 additions & 0 deletions cli/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
<!-- See the ../guides/writing-the-cypress-changelog.md for details on writing the changelog. -->
## 12.6.1

_Released 03/1/2023 (PENDING)_

**Bugfixes:**

- 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).
- 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).

**Misc:**

- 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).

## 12.6.0

_Released 02/15/2023_
Expand Down
26 changes: 25 additions & 1 deletion cli/types/cypress.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1816,9 +1816,21 @@ declare namespace Cypress {
*
* @see https://on.cypress.io/reload
* @example
* cy.visit('http://localhost:3000/admin')
* cy.reload()
*/
reload(options?: Partial<Loggable & Timeoutable>): Chainable<AUTWindow>
reload(): Chainable<AUTWindow>
/**
* Reload the page.
*
* @see https://on.cypress.io/reload
* @param {Partial<Loggable & Timeoutable>} options Pass in an options object to modify the default behavior of cy.reload()
* @example
* // Reload the page, do not log it in the command log and timeout after 15s
* cy.visit('http://localhost:3000/admin')
* cy.reload({log: false, timeout: 15000})
*/
reload(options: Partial<Loggable & Timeoutable>): Chainable<AUTWindow>
/**
* Reload the page without cache
*
Expand All @@ -1830,6 +1842,18 @@ declare namespace Cypress {
* cy.reload(true)
*/
reload(forceReload: boolean): Chainable<AUTWindow>
/**
* Reload the page without cache and with log and timeout options
*
* @see https://on.cypress.io/reload
* @param {Boolean} forceReload Whether to reload the current page without using the cache. true forces the reload without cache.
* @param {Partial<Loggable & Timeoutable>} options Pass in an options object to modify the default behavior of cy.reload()
* @example
* // Reload the page without using the cache, do not log it in the command log and timeout after 15s
* cy.visit('http://localhost:3000/admin')
* cy.reload(true, {log: false, timeout: 15000})
*/
reload(forceReload: boolean, options: Partial<Loggable & Timeoutable>): Chainable<AUTWindow>

/**
* Make an HTTP GET request.
Expand Down
4 changes: 2 additions & 2 deletions packages/app/cypress/e2e/debug.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ describe('App - Debug Page', () => {
cy.findByTestId('debug-header-branch').contains('main')
cy.findByTestId('debug-header-commitHash').contains('e9d176f')
cy.findByTestId('debug-header-author').contains('Lachlan Miller')
cy.findByTestId('debug-header-createdAt').contains('01:18')
cy.findByTestId('debug-header-createdAt').contains('02h 00m 10s')
})

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

cy.findByTestId('spec-contents').within(() => {
Expand Down
1 change: 1 addition & 0 deletions packages/app/cypress/fixtures/debug-Failing/gql-Debug.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"commitInfo": {
"sha": "commit1",
"authorName": "Lachlan Miller",
"authorEmail": "hello@cypress.io",
"summary": "chore: testing cypress",
"branch": "main",
"__typename": "CloudRunCommitInfo"
Expand Down
3 changes: 2 additions & 1 deletion packages/app/cypress/fixtures/debug-Passing/gql-Debug.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@
"runNumber": 2,
"createdAt": "2023-01-30T08:10:59.720Z",
"status": "PASSED",
"totalDuration": 78898,
"totalDuration": 7210000,
"commitInfo": {
"sha": "e9d176f0c00c0428c9945577aec37cb6d48c5a26",
"authorName": "Lachlan Miller",
"authorEmail": "asdf",
"summary": "update projectId",
"branch": "main",
"__typename": "CloudRunCommitInfo"
Expand Down
21 changes: 20 additions & 1 deletion packages/app/src/debug/DebugPageHeader.cy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const defaults = [
{ attr: 'debug-header-branch', text: 'Branch Name: feature/DESIGN-183' },
{ attr: 'debug-header-commitHash', text: 'Commit Hash: b5e6fde' },
{ attr: 'debug-header-author', text: 'Commit Author: cypressDTest' },
{ attr: 'debug-header-createdAt', text: 'Run Total Duration: 01:00 (an hour ago) ' },
{ attr: 'debug-header-createdAt', text: 'Run Total Duration: 01m 00s (an hour ago) ' },
]

describe('<DebugPageHeader />', {
Expand All @@ -22,6 +22,7 @@ describe('<DebugPageHeader />', {
result.commitInfo.summary = 'Adding a hover state to the button component'
result.commitInfo.branch = 'feature/DESIGN-183'
result.commitInfo.authorName = 'cypressDTest'
result.commitInfo.authorEmail = 'adams@cypress.io'
result.commitInfo.sha = 'b5e6fde'
}
}
Expand Down Expand Up @@ -144,4 +145,22 @@ describe('<DebugPageHeader />', {

cy.findByTestId('debug-commitsAhead').should('not.exist')
})

it('renders duration over 1 hour', () => {
cy.mountFragment(DebugPageHeaderFragmentDoc, {
onResult (result) {
if (result) {
result.totalDuration = 3602000000
}
},
render: (gqlVal) => {
return (
<DebugPageHeader gql={gqlVal} commitsAhead={0}/>
)
},
})

cy.findByTestId('debug-header-createdAt')
.should('have.text', 'Run Total Duration: 16h 33m 20s (an hour ago) ')
})
})
17 changes: 13 additions & 4 deletions packages/app/src/debug/DebugPageHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,9 @@
v-if="debug?.commitInfo?.authorName"
data-cy="debug-header-author"
>
<i-cy-general-user_x16
class="mr-1 mr-11px icon-dark-gray-500 icon-light-gray-100 icon-secondary-light-gray-200"
<UserAvatar
class="h-16px mr-8px w-16px"
:email="debug?.commitInfo?.authorEmail"
data-cy="debug-header-avatar"
/>
<span class="sr-only">Commit Author:</span> {{ debug.commitInfo.authorName }}
Expand Down Expand Up @@ -113,8 +114,8 @@ import CommitIcon from '~icons/cy/commit_x14'
import { gql } from '@urql/core'
import { dayjs } from '../runs/utils/day.js'
import { useI18n } from 'vue-i18n'
import { useDurationFormat } from '../composables/useDurationFormat'
import DebugRunNumber from './DebugRunNumber.vue'
import UserAvatar from '@cy/gql-components/topnav/UserAvatar.vue'
const { t } = useI18n()
Expand All @@ -132,6 +133,7 @@ fragment DebugPageHeader on CloudRun {
...RunResults
commitInfo {
authorName
authorEmail
summary
branch
}
Expand All @@ -147,7 +149,14 @@ const debug = computed(() => props.gql)
const relativeCreatedAt = computed(() => dayjs(new Date(debug.value.createdAt!)).fromNow())
const totalDuration = useDurationFormat(debug.value.totalDuration ?? 0)
/*
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
than an hour. Currently, there is no expectation that a run duration will be greater 24 hours or greater, so it is okay that
this format would "roll-over" in that scenario.
Ex: 1 second which is 1000ms = 00m 01s
Ex: 1 hour and 1 second which is 3601000ms = 01h 00m 01s
*/
const totalDuration = computed(() => dayjs.duration(debug.value.totalDuration ?? 0).format('HH[h] mm[m] ss[s]').replace(/^0+h /, ''))
</script>
<style scoped>
Expand Down
4 changes: 2 additions & 2 deletions packages/driver/cypress/e2e/e2e/origin/cookie_login.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,7 @@ describe('cy.origin - cookie login', { browser: '!webkit' }, () => {

cy.getCookie('key').then((cookie) => {
expect(Cypress._.omit(cookie, 'expiry')).to.deep.equal({
domain: '.www.foobar.com',
domain: 'www.foobar.com',
httpOnly: false,
name: 'key',
path: '/fixtures',
Expand Down Expand Up @@ -851,7 +851,7 @@ describe('cy.origin - cookie login', { browser: '!webkit' }, () => {
cy.get('[data-cy="doc-cookie"]').invoke('text').should('equal', 'name=value')
cy.getCookie('name').then((cookie) => {
expect(Cypress._.omit(cookie, 'expiry')).to.deep.equal({
domain: '.www.foobar.com',
domain: 'www.foobar.com',
httpOnly: false,
name: 'name',
path: '/',
Expand Down
Loading

4 comments on commit a6a71e1

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on a6a71e1 Feb 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the linux arm64 version of the Test Runner.

Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/12.6.0/linux-arm64/feature/ct-public-api-a6a71e1798cedc85992704ca9a5dd6c1322b414b/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on a6a71e1 Feb 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the linux x64 version of the Test Runner.

Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/12.6.0/linux-x64/feature/ct-public-api-a6a71e1798cedc85992704ca9a5dd6c1322b414b/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on a6a71e1 Feb 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the darwin x64 version of the Test Runner.

Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/12.6.0/darwin-x64/feature/ct-public-api-a6a71e1798cedc85992704ca9a5dd6c1322b414b/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on a6a71e1 Feb 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the darwin arm64 version of the Test Runner.

Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/12.6.0/darwin-arm64/feature/ct-public-api-a6a71e1798cedc85992704ca9a5dd6c1322b414b/cypress.tgz

Please sign in to comment.