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

cypress runner ignoring charset=“windows-1252” html tag #3725

Closed
opensas opened this issue Mar 17, 2019 · 2 comments
Closed

cypress runner ignoring charset=“windows-1252” html tag #3725

opensas opened this issue Mar 17, 2019 · 2 comments
Labels
type: duplicate This issue or pull request already exists

Comments

@opensas
Copy link

opensas commented Mar 17, 2019

Current behavior:

I'm testing a page encoded with windows-1252 like this:

<html>
<head>
  <title>Meta-SSC</title>
  <meta http-equiv="Content-Type" content="text/html">
  <meta charset="windows-1252">
  [...]

But cypress runner seems not to be taking it into account:

cypress runner ignores windows-1252 encoding

My test are failing because of this.

On the other hand, when testing it on chrome (Version 72.0.3626.121 Official Build 32-bit running on windows 10) or firefox (65.0.2 64bits) it works ok:

windows-1252 encoding runs ok in chrome

Desired behavior:

Cypress runner should correctly handle windows-1252 encoding like chrome and firefox do.

Steps to reproduce: (app code and test code)

This is a minimal example I built:

<html>
<head>
  <meta http-equiv="Content-Type" content="text/html">
  <meta charset="windows-1252">
</head>
<body>
  <h1>Character encoding failing test: á é í ó ú ñ</h1>
</body>

imagen

While on chrome:

imagen

Versions

cypress version:

  "devDependencies": {
    "cypress": "^3.2.0"
  }

os: Microsoft Windows 10 Home, Version 10.0.17134 Build 17134

works ok on:
chrome (Version 72.0.3626.121 Official Build 32-bit running on windows 10)
firefox (65.0.2 64bits)


Also asked at SO

@opensas
Copy link
Author

opensas commented Mar 17, 2019

update: this is the best workaound I could find so far, if anybody has a better alternative I'd be grateful

describe('playing with regular expressions', () => {
  it.only('should match by regular expression', () => {
    cy.visit('http://localhost/metaSSC/cypress/regexp.html')
    cy.get('div.flash_warning span')
      .should('have.text', 'El registro no ha podido ser dado de alta.')
    cy.get('div.flash_error span')
      .contains(/^El c.digo de la aplicacion no puede estar vac.o\.$/) // match span text by regexp
  })
})

@jennifer-shehane
Copy link
Member

Duplicate of #1543

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants