Skip to content

Commit

Permalink
fix: Issue 23486 (#23595)
Browse files Browse the repository at this point in the history
  • Loading branch information
amehta265 authored Aug 29, 2022
1 parent 3c2fea2 commit 6a614c3
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 2 deletions.
37 changes: 37 additions & 0 deletions packages/app/cypress/e2e/cypress-in-cypress.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,42 @@ describe('Cypress in Cypress', { viewportWidth: 1500, defaultCommandTimeout: 100
cy.findByTestId('reporter-panel').should('not.be.visible')
cy.findByTestId('sidebar').should('be.visible')
})

it(`checks that specs load when devServer configuration is not set in open mode for ${testingType}`, () => {
cy.scaffoldProject('cypress-in-cypress')
cy.findBrowsers()
cy.openProject('cypress-in-cypress')
cy.startAppServer()
cy.visitApp()
cy.contains('dom-content.spec').should('exist')
cy.withCtx(async (ctx, o) => {
ctx.coreData.app.browserStatus = 'open'

let config = await ctx.actions.file.readFileInProject('cypress.config.js')

let oldFramework = `framework: 'react',`
let oldBundler = `bundler: 'webpack',`
let oldWebPackConfig = `webpackConfig: require('./webpack.config.js'),`

config = config.replace(oldFramework, ``).replace(oldBundler, ``).replace(oldWebPackConfig, ``).replace(`devServer: {`, ``).replace(/},/i, ``)

await ctx.actions.file.writeFileInProject('cypress.config.js', config)

o.sinon.stub(ctx.actions.browser, 'closeBrowser')
o.sinon.stub(ctx.actions.browser, 'relaunchBrowser')
})

cy.get('[data-cy="loading-spinner"]').should('be.visible')
cy.get('[data-cy="loading-spinner"]').should('not.exist')

// We navigate to another page to ensure the specs page re-renders with the updated changes in cypress config
// so we can assert on an up to date specs page when we navigate back to it.

cy.get('[href="#/runs"]').click()
cy.location('hash').should('eq', '#/runs')
cy.get('[href="#/specs"').click()
cy.contains('accounts_list.spec').should('be.visible')
})
})

it('restarts browser if there is a change on the config file affecting the browser', () => {
Expand All @@ -265,6 +301,7 @@ describe('Cypress in Cypress', { viewportWidth: 1500, defaultCommandTimeout: 100
let config = await ctx.actions.file.readFileInProject('cypress.config.js')

config = config.replace(`e2e: {`, `e2e: {\n chromeWebSecurity: false,\n`)

await ctx.actions.file.writeFileInProject('cypress.config.js', config)

o.sinon.stub(ctx.actions.browser, 'closeBrowser')
Expand Down
2 changes: 1 addition & 1 deletion packages/data-context/src/actions/ProjectActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ export class ProjectActions {
const config = this.ctx.lifecycleManager.loadedConfigFile

// If devServer is a function, they are using a custom dev server.
if (typeof config?.component?.devServer === 'function') {
if (!config?.component?.devServer || typeof config?.component?.devServer === 'function') {
return undefined
}

Expand Down
4 changes: 4 additions & 0 deletions packages/graphql/schemas/cloud.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -668,10 +668,14 @@ type Mutation {
Create a project in the dashboard and return its object
"""
cloudProjectCreate(
campaign: String
ciProviders: [String!]
cohort: String
medium: String
name: String!
orgId: ID!
public: Boolean!
source: String
): CloudProject

"""
Expand Down
2 changes: 1 addition & 1 deletion packages/graphql/schemas/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -1188,7 +1188,7 @@ type Mutation {
closeBrowser: Boolean

"""Create a project in the dashboard and return its object"""
cloudProjectCreate(ciProviders: [String!], name: String!, orgId: ID!, public: Boolean!): CloudProject
cloudProjectCreate(campaign: String, ciProviders: [String!], cohort: String, medium: String, name: String!, orgId: ID!, public: Boolean!, source: String): CloudProject

"""Request access to an organization from a projectId"""
cloudProjectRequestAccess(projectSlug: String!): CloudProjectResult
Expand Down

5 comments on commit 6a614c3

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 6a614c3 Aug 29, 2022

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/10.7.0/linux-x64/develop-6a614c312eb7d5fafc081f193edcd20ac9ada92d/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 6a614c3 Aug 29, 2022

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 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/10.7.0/linux-arm64/develop-6a614c312eb7d5fafc081f193edcd20ac9ada92d/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 6a614c3 Aug 29, 2022

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 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/10.7.0/darwin-arm64/develop-6a614c312eb7d5fafc081f193edcd20ac9ada92d/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 6a614c3 Aug 29, 2022

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 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/10.7.0/darwin-x64/develop-6a614c312eb7d5fafc081f193edcd20ac9ada92d/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 6a614c3 Aug 29, 2022

Choose a reason for hiding this comment

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

Circle has built the win32 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/10.7.0/win32-x64/develop-6a614c312eb7d5fafc081f193edcd20ac9ada92d/cypress.tgz

Please sign in to comment.