Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: updated scaffolding, new project & user banners, ability to remove scaffolding #15826

Merged
merged 72 commits into from Jun 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
868472c
update example build scripts
panzarino Apr 6, 2021
735a9ba
remove old scaffolding relics
panzarino Apr 6, 2021
8ebce4b
update
panzarino Apr 13, 2021
383ca99
Merge branch 'develop' into GROW-175
panzarino Apr 13, 2021
141b163
Fix some issues with scaffolding
panzarino Apr 21, 2021
b1a965c
Correctly fix issues with scaffolding
panzarino Apr 21, 2021
83aff16
Replace old onboarding with new banner
panzarino Apr 22, 2021
7483d91
Add ability to remove scaffolded files
panzarino Apr 22, 2021
c8d4c2d
Add banner for new users
panzarino Apr 23, 2021
3300c6b
Update tests for new scaffolding
panzarino Apr 27, 2021
78059e2
Compare file sizes before removing
panzarino Apr 27, 2021
ea04458
Merge branch 'develop' into GROW-175
panzarino Apr 27, 2021
8965dec
Add tests for remove file
panzarino Apr 28, 2021
89710b3
Save when user opened cypress rather than boolean
panzarino Apr 28, 2021
a569a68
Update intro link and add tets for banners
panzarino Apr 28, 2021
e4321a1
fix small issue
panzarino May 3, 2021
f3d0638
Update design and copy of onboarding banners
panzarino May 5, 2021
f8b3a01
Update style of new spec file button
panzarino May 5, 2021
708b6fa
Improve outline button active statE
panzarino May 5, 2021
bf60111
Merge branch 'develop' into GROW-175
panzarino May 5, 2021
4944a99
Update design of new project a bit more
panzarino May 5, 2021
b708e25
Fix specs list tests
panzarino May 5, 2021
ce249b9
Update banner copy and layout
panzarino May 13, 2021
14b1a20
Merge branch 'develop' into GROW-175
panzarino May 13, 2021
b0d75f9
Update banner copy and layout
panzarino May 14, 2021
f1ac9cf
Switch to docs style alerts
panzarino May 14, 2021
5ea7094
Fix testing logic
panzarino May 14, 2021
e8c5a66
Merge branch 'develop' into GROW-175
panzarino May 17, 2021
96b4df0
Merge branch 'GROW-175-B' into GROW-175
panzarino May 17, 2021
e3bb397
Update banner styles a bit
panzarino May 18, 2021
d862841
Update banners
panzarino May 19, 2021
6a5932e
Add confirmation modal for delete specs
panzarino May 19, 2021
76c8230
Merge branch 'develop' into GROW-175
panzarino May 19, 2021
a26bacf
Update tests and fix states
panzarino May 20, 2021
ddd187c
Upgrade kitchensink dep
panzarino May 21, 2021
6d0d544
Merge branch 'develop' into GROW-175
panzarino May 21, 2021
0630a36
Upgrade kitchen sink version and fix unit tests
panzarino May 21, 2021
ee241ae
Update integration scaffolding test
panzarino May 21, 2021
6c14739
Merge branch 'develop' into GROW-175
panzarino May 24, 2021
5368615
Merge branch 'develop' into GROW-175
panzarino May 24, 2021
8715eeb
Add further description to warning modal
panzarino May 24, 2021
b5b962d
Update test for new user and new project case
panzarino May 24, 2021
7ee1757
Merge branch 'develop' into GROW-175
panzarino May 24, 2021
5ea7155
Remove check to file tree when removing files
panzarino May 24, 2021
68f6364
Merge branch 'develop' into GROW-175
panzarino Jun 9, 2021
36875b8
Update kitchensink version
panzarino Jun 10, 2021
8109c01
Fix edge case where banner could appear when no files have been scaff…
panzarino Jun 12, 2021
107598b
Merge branch 'develop' into GROW-175
panzarino Jun 13, 2021
9d55ae1
Fix tests
panzarino Jun 16, 2021
cecc048
Merge branch 'develop' into GROW-175
panzarino Jun 16, 2021
957553b
Update styling for 'note' when deleting files
jennifer-shehane Jun 17, 2021
db8fe5e
fix issue with path on windows
panzarino Jun 17, 2021
cca1167
Merge branch 'develop' into GROW-175
panzarino Jun 17, 2021
1cdc342
Change remove command
panzarino Jun 17, 2021
153534d
Merge branch 'develop' into GROW-175
panzarino Jun 17, 2021
0db6a32
Fix rm dir
panzarino Jun 17, 2021
93e5c17
Fix for windows
panzarino Jun 21, 2021
7777fcb
Merge branch 'develop' into GROW-175
panzarino Jun 21, 2021
7c9945a
Try to use appveyor to test
panzarino Jun 21, 2021
01a9ae8
appveyor please
panzarino Jun 21, 2021
f8fa182
getting some feedback
panzarino Jun 21, 2021
55fac95
Why doesn't this work
panzarino Jun 21, 2021
b184aac
more info
panzarino Jun 21, 2021
28bb6b4
I have a feeling this works
panzarino Jun 21, 2021
c27d5a5
maybe its the other path
panzarino Jun 21, 2021
93417e5
please
panzarino Jun 21, 2021
724ec3c
this is the one
panzarino Jun 21, 2021
2019410
this is it
panzarino Jun 21, 2021
ce7183f
this should work
panzarino Jun 22, 2021
95a4ae6
try reverting that change that might not be needed
panzarino Jun 22, 2021
e1e0178
remove appveyor testing scaffolding
panzarino Jun 22, 2021
c60654a
Merge branch 'develop' into GROW-175
panzarino Jun 22, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 0 additions & 2 deletions cli/types/cypress.d.ts
Expand Up @@ -2763,8 +2763,6 @@ declare namespace Cypress {
clientRoute: string
configFile: string
cypressEnv: string
integrationExampleName: string
integrationExamplePath: string
isNewProject: boolean
isTextTerminal: boolean
morgan: boolean
Expand Down
2 changes: 0 additions & 2 deletions packages/desktop-gui/cypress/fixtures/config.json
Expand Up @@ -128,8 +128,6 @@
"execTimeout": 60000,
"fileServerFolder": "/Users/jennifer/Dev/Projects/cypress-example-kitchensink",
"fixturesFolder": "/Users/jennifer/Dev/Projects/cypress-example-kitchensink/cypress/fixtures",
"integrationExamplePath": "/Users/jennifer/Dev/Projects/cypress-example-kitchensink/cypress/integration/examples",
"integrationExampleName": "examples",
"integrationFolder": "/Users/jennifer/Dev/Projects/cypress-example-kitchensink/cypress/integration",
"isHeadless": false,
"isNewProject": false,
Expand Down
111 changes: 46 additions & 65 deletions packages/desktop-gui/cypress/integration/specs_list_spec.js
Expand Up @@ -24,10 +24,11 @@ describe('Specs List', function () {
cy.stub(this.ipc, 'openFinder')
cy.stub(this.ipc, 'openFile')
cy.stub(this.ipc, 'externalOpen')
cy.stub(this.ipc, 'onboardingClosed')
cy.stub(this.ipc, 'hasOpenedCypress').resolves(true)
cy.stub(this.ipc, 'onSpecChanged')
cy.stub(this.ipc, 'setUserEditor')
cy.stub(this.ipc, 'showNewSpecDialog').resolves({ specs: null, path: null })
cy.stub(this.ipc, 'removeScaffoldedFiles').resolves()

this.openProject = this.util.deferred()
cy.stub(this.ipc, 'openProject').returns(this.openProject.promise)
Expand Down Expand Up @@ -58,8 +59,10 @@ describe('Specs List', function () {
})
})

it('displays help link', () => {
cy.contains('a', 'Need help?')
it('launches system save dialog on click of new spec file', function () {
cy.contains('New Spec File').click().then(function () {
expect(this.ipc.showNewSpecDialog).to.be.called
})
})

it('opens link to docs on click of help link', () => {
Expand Down Expand Up @@ -96,98 +99,76 @@ describe('Specs List', function () {
})
})

describe('first time onboarding specs', function () {
describe('new project onboarding', function () {
beforeEach(function () {
this.config.isNewProject = true

this.openProject.resolve(this.config)
})

context('modal', () => {
it('displays', () => {
cy.contains('.modal', 'To help you get started').should('be.visible')
context('banner', function () {
it('displays', function () {
cy.get('.new-project-banner')
cy.percySnapshot()
})

it('displays the scaffolded files', () => {
cy.get('.folder-preview-onboarding').within(function () {
cy.contains('span', 'fixtures').siblings('ul').within(function () {
})

cy.contains('example.json')
cy.contains('span', 'integration').siblings('ul').within(() => {
cy.contains('examples')
})

cy.contains('span', 'support').siblings('ul').within(function () {
cy.contains('commands.js')
cy.contains('defaults.js')

cy.contains('index.js')
})

cy.contains('span', 'plugins').siblings('ul').within(() => {
cy.contains('index.js')
})
})
})

it('lists folders and files alphabetically', () => {
cy.get('.folder-preview-onboarding').within(() => {
cy.contains('fixtures').parent().next()
.contains('integration')
})
it('is dismissable', function () {
cy.get('.new-project-banner').find('.close').click()
cy.get('.new-project-banner').should('not.exist')
})

it('truncates file lists with more than 3 items', () => {
cy.get('.folder-preview-onboarding').within(function () {
cy.contains('examples').closest('.new-item').find('li')
.should('have.length', 3)
it('does not display new user banner even when closed', function () {
this.ipc.hasOpenedCypress.resolves(false)

cy.get('.is-more').should('have.text', ' ... 17 more files ...')
})
cy.get('.new-user-banner').should('not.exist')
cy.get('.new-project-banner').find('.close').click()
cy.get('.new-project-banner').should('not.exist')
cy.get('.new-user-banner').should('not.exist')
})

it('can dismiss the modal', function () {
cy.contains('OK, got it!').click()

cy.get('.modal').should('not.be.visible')
.then(function () {
expect(this.ipc.onboardingClosed).to.be.called
it('opens link to docs on click of help link', function () {
cy.contains('a', 'How to write your first test').click().then(function () {
expect(this.ipc.externalOpen).to.be.calledWithMatch({ url: 'https://on.cypress.io/writing-first-test' })
})
})

it('triggers open:finder on click of example folder', function () {
cy.get('.modal').contains('examples').click().then(() => {
expect(this.ipc.openFinder).to.be.calledWith(this.config.integrationExamplePath)
it('removes scaffolded files on click and confirmation', function () {
cy.contains('delete example files').click()
cy.get('.confirm-remove-scaffolded-files').should('be.visible')
cy.contains('Yes, delete files').click().then(function () {
expect(this.ipc.removeScaffoldedFiles).to.be.called
cy.get('.new-project-banner').should('not.exist')
})
})
})
})

it('triggers open:finder on click of text folder', function () {
cy.get('.modal').contains('cypress/integration').click().then(() => {
expect(this.ipc.openFinder).to.be.calledWith(this.config.integrationFolder)
})
})
describe('first time user in existing project', function () {
beforeEach(function () {
this.openProject.resolve(this.config)
this.ipc.hasOpenedCypress.resolves(false)
})

context('banner', function () {
beforeEach(function () {
cy.get('.modal').find('.btn-success').click()
})

it('displays', function () {
cy.get('.first-test-banner')
cy.get('.new-user-banner')
cy.percySnapshot()
})

it('is dismissable', function () {
cy.get('.first-test-banner').find('.close').click()
cy.get('.first-test-banner').should('not.exist')
cy.get('.new-user-banner').find('.close').click()
cy.get('.new-user-banner').should('not.exist')
})

it('opens link to docs on click of help link', function () {
cy.contains('a', 'How to write tests').click().then(function () {
expect(this.ipc.externalOpen).to.be.calledWith('https://on.cypress.io/writing-first-test')
it('opens link to docs on click of how to link', function () {
cy.contains('a', 'How to write your first test').click().then(function () {
expect(this.ipc.externalOpen).to.be.calledWithMatch({ url: 'https://on.cypress.io/writing-first-test' })
})
})

it('opens link to intro guide on click of intro link', function () {
cy.contains('a', 'Introduction guide to Cypress').click().then(function () {
expect(this.ipc.externalOpen).to.be.calledWithMatch({ url: 'https://on.cypress.io/intro-to-cypress' })
})
})
})
Expand Down
6 changes: 3 additions & 3 deletions packages/desktop-gui/src/app/intro.jsx
Expand Up @@ -34,8 +34,8 @@ class Default extends Component {
onDrop={this._drop}
>
<span className="fa-stack fa-lg">
<i className="fas fa-folder fa-stack-2x"></i>
<i className="fas fa-plus fa-stack-1x"></i>
<i className="fas fa-folder fa-stack-2x" />
<i className="fas fa-plus fa-stack-1x" />
</span>
<p>Drag your project here or <a href="#" onClick={this._selectProject}>select manually</a>.</p>
</div>
Expand All @@ -51,7 +51,7 @@ class Default extends Component {
return (
<div className='local-install-notice alert alert-info alert-dismissible'>
<p className='text-center'>
<i className='fas fa-info-circle'></i>{' '}
<i className='fas fa-info-circle' />{' '}
We recommend versioning Cypress per project and{' '}
<a onClick={this._openHelp} className='helper-docs-link'>
installing it via <span className='mono'>npm</span>
Expand Down
4 changes: 3 additions & 1 deletion packages/desktop-gui/src/lib/ipc.js
Expand Up @@ -71,7 +71,9 @@ register('updater:check', false)
register('updater:run', false)
register('window:open')
register('window:close')
register('onboarding:closed')
register('new:project:banner:closed')
register('has:opened:cypress')
register('remove:scaffolded:files')
register('set:clipboard:text')
register('set:prompt:shown')

Expand Down
2 changes: 1 addition & 1 deletion packages/desktop-gui/src/project-nav/browsers.jsx
Expand Up @@ -35,7 +35,7 @@ export default class Browsers extends Component {
return (
<li className='close-browser'>
<button className='btn btn-xs btn-danger' onClick={this._closeBrowser.bind(this)}>
<i className='fas fa-fw fa-times'></i>
<i className='fas fa-fw fa-times' />
Stop
</button>
</li>
Expand Down
6 changes: 3 additions & 3 deletions packages/desktop-gui/src/project-nav/project-nav.jsx
Expand Up @@ -12,19 +12,19 @@ export default class ProjectNav extends Component {
<ul className='nav left-nav'>
<li>
<Link to={routes.specs(project)}>
<i className='fas fa-code'></i>{' '}
<i className='fas fa-code' />{' '}
Tests
</Link>
</li>
<li>
<Link to={routes.runs(project)}>
<i className='fas fa-database'></i>{' '}
<i className='fas fa-database' />{' '}
Runs
</Link>
</li>
<li>
<Link to={routes.settings(project)}>
<i className='fas fa-cog'></i>{' '}
<i className='fas fa-cog' />{' '}
Settings
</Link>
</li>
Expand Down
131 changes: 0 additions & 131 deletions packages/desktop-gui/src/project/onboarding.jsx

This file was deleted.