Skip to content

Commit

Permalink
chore: resolving merge conflict bw develop and ct
Browse files Browse the repository at this point in the history
  • Loading branch information
JessicaSachs committed Feb 3, 2021
1 parent cbcf0d4 commit ad08b6d
Show file tree
Hide file tree
Showing 49 changed files with 576 additions and 159 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/jira-issue-sync.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Create Internal Issue on Jira from Issue

on:
# https://docs.github.com/en/actions/reference/events-that-trigger-workflows#issues
# https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#issues
issues:
types: [labeled]

jobs:
create-jira-issue-from-labeled-issue:
runs-on: ubuntu-latest
steps:
- name: Log label
if: github.event.label.name != 'internal-priority'
run: echo Label is ${{ github.event.label.name }} - skipping next steps

# https://github.com/atlassian/gajira-login
- name: Jira login
id: login
if: github.event.label.name == 'internal-priority'
uses: atlassian/gajira-login@master
env:
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}

# https://github.com/atlassian/gajira-create
- name: Create TR Jira issue for internal-priority labels
id: create_jira_internal_priority_issue
if: github.event.label.name == 'internal-priority'
uses: atlassian/gajira-create@master
with:
project: TR
issuetype: Bug
summary: |
${{ github.event.issue.title }}
description: |
Created via GitHub Action with 'internal-priority' label.
# Find all available fields JIRA_BASE_URL/rest/api/3/field
fields: '{"customfield_10032": "${{ github.event.issue.html_url }}"}'

# https://github.com/actions/github-script
- name: Add comment to GitHub issue
if: github.event.label.name == 'internal-priority'
uses: actions/github-script@v3
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
github.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: 'Internal Jira issue: [${{ steps.create_jira_internal_priority_issue.outputs.issue }}](${{ secrets.JIRA_BASE_URL }}/browse/${{ steps.create_jira_internal_priority_issue.outputs.issue }})'
})
55 changes: 55 additions & 0 deletions .github/workflows/jira-pr-sync.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Create Internal Issue on Jira from PR

on:
# https://docs.github.com/en/actions/reference/events-that-trigger-workflows#pull_request
# https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#pull_request
pull_request:
types: [labeled]

jobs:
create-jira-issue-from-labeled-pr:
runs-on: ubuntu-latest
steps:
- name: Log label
if: github.event.label.name != 'internal-priority'
run: echo Label is ${{ github.event.label.name }} - skipping next steps

# https://github.com/atlassian/gajira-login
- name: Jira login
id: login
if: github.event.label.name == 'internal-priority'
uses: atlassian/gajira-login@master
env:
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}

# https://github.com/atlassian/gajira-create
- name: Create TR Jira issue for internal-priority labels
id: create_jira_internal_priority_issue
if: github.event.label.name == 'internal-priority'
uses: atlassian/gajira-create@master
with:
project: TR
issuetype: Bug
summary: |
${{ github.event.pull_request.title }}
description: |
Created via GitHub Action with 'internal-priority' label.
# Find all available fields JIRA_BASE_URL/rest/api/3/field
fields: '{"customfield_10032": "${{ github.event.pull_request.html_url }}"}'


# https://github.com/actions/github-script
- name: Add comment to GitHub PR
if: github.event.label.name == 'internal-priority'
uses: actions/github-script@v3
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
github.issues.createComment({
issue_number: context.payload.pull_request.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: 'Internal Jira issue: [${{ steps.create_jira_internal_priority_issue.outputs.issue }}](${{ secrets.JIRA_BASE_URL }}/browse/${{ steps.create_jira_internal_priority_issue.outputs.issue }})'
})
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cypress",
"version": "6.3.0",
"version": "6.4.0",
"description": "Cypress.io end to end testing tool",
"private": true,
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion packages/desktop-gui/cypress/integration/footer_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ describe('Footer', () => {

it('opens link to changelog on click of changelog', () => {
cy.contains('button', 'Changelog').click().then(() => {
expect(ipc.externalOpen).to.be.calledWith('https://on.cypress.io/changelog?source=dgui_footer')
expect(ipc.externalOpen).to.be.calledWithMatch({ url: 'https://on.cypress.io/changelog' })
})
})

Expand Down
3 changes: 2 additions & 1 deletion packages/desktop-gui/cypress/integration/login_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ describe('Login', function () {

it('passes utm code when it triggers ipc "begin:auth"', function () {
cy.then(function () {
expect(this.ipc.beginAuth).to.be.calledWith('Nav Login Button')
// we match nav in this test since the outer beforeEach initializes the modal from the navbar
expect(this.ipc.beginAuth).to.be.calledWith('Nav')
})
})

Expand Down
4 changes: 2 additions & 2 deletions packages/desktop-gui/cypress/integration/nav_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ describe('Navigation', function () {

it('displays and opens link to docs on click', () => {
cy.get('nav').find('.fa-graduation-cap').click().then(function () {
expect(this.ipc.externalOpen).to.be.calledWith('https://on.cypress.io')
expect(this.ipc.externalOpen).to.be.calledWithMatch({ url: 'https://on.cypress.io/docs' })
})
})

it('displays and opens link to support on click', () => {
cy.get('nav').find('.fa-question-circle').click().then(function () {
expect(this.ipc.externalOpen).to.be.calledWith('https://on.cypress.io/support')
expect(this.ipc.externalOpen).to.be.calledWithMatch({ url: 'https://on.cypress.io/support' })
})
})

Expand Down
2 changes: 1 addition & 1 deletion packages/desktop-gui/cypress/integration/runs_list_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ describe('Runs List', function () {

it('clicking Log In to Dashboard passes utm code', () => {
cy.contains('button', 'Log In to Dashboard').click().then(function () {
expect(this.ipc.beginAuth).to.be.calledWith('Runs Tab Login Button')
expect(this.ipc.beginAuth).to.be.calledWith('Runs Tab')
})
})
})
Expand Down
10 changes: 5 additions & 5 deletions packages/desktop-gui/cypress/integration/settings_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ describe('Settings', () => {

it('opens help link on click', () => {
cy.get('.settings-config .learn-more').click().then(function () {
expect(this.ipc.externalOpen).to.be.calledWith('https://on.cypress.io/guides/configuration')
expect(this.ipc.externalOpen).to.be.calledWithMatch({ url: 'https://on.cypress.io/guides/configuration' })
})
})

Expand Down Expand Up @@ -413,7 +413,7 @@ describe('Settings', () => {

it('opens ci guide when learn more is clicked', () => {
cy.get('.settings-record-key').contains('Learn more').click().then(function () {
expect(this.ipc.externalOpen).to.be.calledWith('https://on.cypress.io/what-is-a-record-key')
expect(this.ipc.externalOpen).to.be.calledWithMatch({ url: 'https://on.cypress.io/what-is-a-record-key' })
})
})

Expand Down Expand Up @@ -606,7 +606,7 @@ describe('Settings', () => {

it('opens help link on click', () => {
cy.get('.settings-proxy .learn-more').click().then(function () {
expect(this.ipc.externalOpen).to.be.calledWith('https://on.cypress.io/proxy-configuration')
expect(this.ipc.externalOpen).to.be.calledWithMatch({ url: 'https://on.cypress.io/proxy-configuration' })
})
})

Expand Down Expand Up @@ -697,7 +697,7 @@ describe('Settings', () => {
const hasLearnMoreLink = () => {
cy.get('[data-cy=experiments]').contains('a', 'Learn more').click()
.then(function () {
expect(this.ipc.externalOpen).to.be.calledWith('https://on.cypress.io/experiments')
expect(this.ipc.externalOpen).to.be.calledWithMatch({ url: 'https://on.cypress.io/experiments' })
})
}

Expand Down Expand Up @@ -785,7 +785,7 @@ describe('Settings', () => {

it('opens file preference guide when learn more is clicked', () => {
cy.get('.file-preference').contains('Learn more').click().then(function () {
expect(this.ipc.externalOpen).to.be.calledWith('https://on.cypress.io/file-opener-preference')
expect(this.ipc.externalOpen).to.be.calledWithMatch({ url: 'https://on.cypress.io/file-opener-preference' })
})
})

Expand Down
28 changes: 20 additions & 8 deletions packages/desktop-gui/src/app/nav.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ export default class Nav extends Component {
<ul className='nav'>
<li>
<a onClick={this._openSupport} href='#'>
<i className='fas fa-question-circle'></i> Support
<i className='fas fa-question-circle' /> Support
</a>
</li>
<li>
<a onClick={this._openDocs} href='#'>
<i className='fas fa-graduation-cap'></i> Docs
<i className='fas fa-graduation-cap' /> Docs
</a>
</li>
{this._userStateButton()}
Expand All @@ -50,15 +50,15 @@ export default class Nav extends Component {
if (appStore.isGlobalMode && project) {
return (
<Link to={routes.intro()}>
<i className='fas fa-chevron-left'></i> Back
<i className='fas fa-chevron-left' /> Back
</Link>
)
}

// global mode, on intro page
return (
<div className='logo'>
<img src={require('@cypress/icons/dist/logo/cypress-inverse.png')} />
<img src={require('@cypress/icons/dist/logo/cypress-inverse.png')} alt="Cypress" />
</div>
)
}
Expand Down Expand Up @@ -113,7 +113,7 @@ export default class Nav extends Component {

return (
<span>
<i className='fas fa-sign-out-alt'></i>{' '}
<i className='fas fa-sign-out-alt' />{' '}
Log Out
</span>
)
Expand All @@ -126,16 +126,28 @@ export default class Nav extends Component {
}

_showLogin () {
authStore.openLogin()
authStore.openLogin(null, 'Nav')
}

_openDocs (e) {
e.preventDefault()
ipc.externalOpen('https://on.cypress.io')
ipc.externalOpen({
url: 'https://on.cypress.io/docs',
params: {
utm_medium: 'Nav',
utm_campaign: 'Docs',
},
})
}

_openSupport (e) {
e.preventDefault()
ipc.externalOpen('https://on.cypress.io/support')
ipc.externalOpen({
url: 'https://on.cypress.io/support',
params: {
utm_medium: 'Nav',
utm_campaign: 'Support',
},
})
}
}
5 changes: 4 additions & 1 deletion packages/desktop-gui/src/auth/auth-store.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import User from '../lib/user-model'
class AuthStore {
@observable isLoading = true
@observable isShowingLogin = false
@observable loginUTM = null
@observable user = null
@observable message = null

Expand All @@ -19,11 +20,12 @@ class AuthStore {
this.message = message
}

@action openLogin (onCloseCb) {
@action openLogin (onCloseCb, loginUTM = null) {
this.onCloseCb = onCloseCb

this.setMessage(null)
this.isShowingLogin = true
this.loginUTM = loginUTM
}

@action closeLogin () {
Expand All @@ -33,6 +35,7 @@ class AuthStore {

this.setMessage(null)
this.isShowingLogin = false
this.loginUTM = false
}

@action setUser (user) {
Expand Down
6 changes: 3 additions & 3 deletions packages/desktop-gui/src/auth/login-form.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,15 @@ class LoginForm extends Component {
if (message && message.name === 'AUTH_COULD_NOT_LAUNCH_BROWSER') {
return (
<span>
<i className='fas fa-exclamation-triangle'></i>{' '}
<i className='fas fa-exclamation-triangle' />{' '}
Could not open browser.
</span>
)
}

return (
<span>
<i className='fas fa-spinner fa-spin'></i>{' '}
<i className='fas fa-spinner fa-spin' />{' '}
{message && message.browserOpened ? 'Waiting for browser login...' : 'Opening browser...'}
</span>
)
Expand All @@ -90,7 +90,7 @@ class LoginForm extends Component {
return (
<div className='alert alert-danger'>
<p>
<i className='fas fa-exclamation-triangle'></i>{' '}
<i className='fas fa-exclamation-triangle' />{' '}
<strong>Can't Log In</strong>
</p>
<p>{this._errorMessage(error.message)}</p>
Expand Down
10 changes: 5 additions & 5 deletions packages/desktop-gui/src/auth/login-modal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ class LoginContent extends Component {
return (
<div className='modal-body login'>
<BootstrapModal.Dismiss className='btn btn-link close'>x</BootstrapModal.Dismiss>
<h1><i className='fas fa-lock'></i> Log In</h1>
<h1><i className='fas fa-lock' /> Log In</h1>
<p>Logging in gives you access to the <a onClick={this._openDashboard}>Cypress Dashboard Service</a>. You can set up projects to be recorded and see test data from your project.</p>
<LoginForm utm='Nav Login Button' onSuccess={() => this.setState({ succeeded: true })} />
<LoginForm utm={authStore.loginUTM} onSuccess={() => this.setState({ succeeded: true })} />
</div>
)
}
Expand All @@ -79,7 +79,7 @@ class LoginContent extends Component {
return (
<div className='modal-body login'>
<BootstrapModal.Dismiss className='btn btn-link close'>x</BootstrapModal.Dismiss>
<h1><i className='fas fa-check'></i> Login Successful</h1>
<h1><i className='fas fa-check' /> Login Successful</h1>
<p>You are now logged in{authStore.user ? ` as ${authStore.user.displayName}` : ''}.</p>
{
!authStore.user.name ?
Expand All @@ -102,14 +102,14 @@ class LoginContent extends Component {
return (
<div className='modal-body login login-no-api-server'>
<BootstrapModal.Dismiss className='btn btn-link close'>x</BootstrapModal.Dismiss>
<h4><i className='fas fa-wifi'></i> Cannot connect to API server</h4>
<h4><i className='fas fa-wifi' /> Cannot connect to API server</h4>
<p>Logging in requires connecting to an external API server. We tried but failed to connect to the API server at <em>{this.state.apiUrl}</em></p>
<p>
<button
className='btn btn-default btn-sm'
onClick={this._pingApiServer}
>
<i className='fas fa-sync-alt'></i>{' '}
<i className='fas fa-sync-alt' />{' '}
Try again
</button>
</p>
Expand Down
9 changes: 8 additions & 1 deletion packages/desktop-gui/src/footer/footer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,14 @@ import UpdateNotice from '../update/update-notice'
const openChangelog = (e) => {
e.target.blur()

ipc.externalOpen('https://on.cypress.io/changelog?source=dgui_footer')
ipc.externalOpen({
url: 'https://on.cypress.io/changelog',
params: {
source: 'dgui_footer',
utm_medium: 'Footer',
utm_campaign: 'Changelog',
},
})
}

const Footer = observer(() => {
Expand Down
Loading

1 comment on commit ad08b6d

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on ad08b6d Feb 3, 2021

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 platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/6.4.1/circle-feat/component-testing-ad08b6d56175b1563d6e7659027c78bf76149925/cypress.tgz

Please sign in to comment.