Skip to content

Cypress.config('baseUrl') escapes slash #3540

@Saibamen

Description

@Saibamen

Current behavior:

image

Desired behavior:

image

Steps to reproduce: (app code and test code)

cypress.json

{
  "env": {
    "test_url": "http://localhost:3000/"
  },
  "baseUrl": "http://localhost:3000/"
}

Example test:

it('test url', function () {
    cy.visit('/')
    var baseUrl = Cypress.config('baseUrl')
    //baseUrl = baseUrl + '/'    // bug in Cypress - add slash
    cy.url().should('eq', Cypress.env('test_url'))
    cy.url().should('eq', baseUrl)
})

Versions

Windows, Cypress 3.1.5

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions