cypress-io / cypress

Fast, easy and reliable testing for anything that runs in a browser.
https://cypress.io
MIT License
46.87k stars 3.17k forks source link

backslash #1179

Closed kemalbayar closed 5 years ago

kemalbayar commented 6 years ago

Test code:

var alertCategories = [
    'Malware', 'Reconnaissance', 'Traffic', 'Vulnerability', 'Web', 'Honeypot', 'Database',
    'System', 'D\\Dos', 'File', 'Identity', 'BruteForce', 'Exploit', 'Attack', 'Mail',
    'Add New Category']

  cy.get('.select2-results div').each(($div, i) => {

            expect($div).to.contain(alertCategories[i])

          })

what I want to test/compare is D\Dos and thus, I use D\\Dos in the array (on the web page the string is located as D\Dos ...)

Message:  expected <div#select2-result-label-43.select2-result-label> to contain D\\Dos
cypress_runner.js:138190 Error:    AssertionError: expected '<div#select2-result-label-43.select2-result-label>' to contain 'D\\Dos'
kemalbayar commented 6 years ago

I recognised that double backslahes in my comments is being cropped

I used double backslash in alertCategories variable

bahmutov commented 6 years ago

Is this a bug report or a question? What did you expect to happen and what is happening? Screenshot? What do you think we can do for this issue?

Sent from my iPhone

On Jan 10, 2018, at 08:53, Kemal notifications@github.com wrote:

I recognised that double backslahes in my comments is being cropped

I used double backslash in alertCategories variable

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

jennifer-shehane commented 6 years ago

@kemalbayar I cleaned up the formatting of the issue so the double backslash is clear.

kemalbayar commented 6 years ago

it may be a bug. I use double backslash to gain D\DOS (to search and find D\DOS with single backslash) but i dont understand why I take this error message

kemalbayar commented 6 years ago

what I want to search and find is D\DOS what I used in the array is DdoublebackslashDos

bahmutov commented 6 years ago

Please setup a reproducible failing test in a new repository or by forking https://github.com/cypress-io/cypress-test-tiny and putting HTML and test that we can look at.

jennifer-shehane commented 5 years ago

Unfortunately we'll have to close this issue if no reproducible example is provided. Can you provide a way to reproduce this?