You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 6, 2020. It is now read-only.
Define a page in pages.js or wherever you define your list of pages which uses a regular expression such as: 'a profile': /\/profile\/\d+$/, Note this is not a string holding a regular expression pattern, but is an actual RegEx object.
Write a Cypress test using cypress-scenario-runner which asserts "is on " (whatever the key in the pages map is)
Expected behavior: Asserting that the browser is "on" a particular page passes if the page's path matches a supplied regular expression pattern.
Observed behavior: Asserting that the browser is "on" a particular page fails with an exception when the given path is a regular expression. Stack trace below
cypress_runner.js:178266 TypeError: path.startsWith is not a function
at Context.isOnPage (https://www.brandon-ramirez.tnbsdev.com/__cypress/tests?p=cypress/features/development/profiles/heading.feature-169:41121:13)
at Context.<anonymous> (https://www.brandon-ramirez.tnbsdev.com/__cypress/tests?p=cypress/features/development/profiles/heading.feature-169:41487:23)
at Context.resolveAndRunStepDefinition (https://www.brandon-ramirez.tnbsdev.com/__cypress/tests?p=cypress/features/development/profiles/heading.feature-169:40965:9)
at Context.<anonymous> (https://www.brandon-ramirez.tnbsdev.com/__cypress/tests?p=cypress/features/development/profiles/heading.feature-169:40334:35)
From previous event:
at Context.thenFn (https://www.brandon-ramirez.tnbsdev.com/__cypress/runner/cypress_runner.js:89201:23)
at Context.then (https://www.brandon-ramirez.tnbsdev.com/__cypress/runner/cypress_runner.js:89525:21)
at Context.<anonymous> (https://www.brandon-ramirez.tnbsdev.com/__cypress/runner/cypress_runner.js:100860:21)
at https://www.brandon-ramirez.tnbsdev.com/__cypress/runner/cypress_runner.js:100381:33
From previous event:
at runCommand (https://www.brandon-ramirez.tnbsdev.com/__cypress/runner/cypress_runner.js:100363:14)
at next (https://www.brandon-ramirez.tnbsdev.com/__cypress/runner/cypress_runner.js:100498:14)
at https://www.brandon-ramirez.tnbsdev.com/__cypress/runner/cypress_runner.js:100521:18
Note: I tried temporarily switching to a string holding a regex pattern and the pattern would never match. Not sure if I did something wrong or if there is a further bug there.
The text was updated successfully, but these errors were encountered:
I found a bug in
isOnPage
andisNotOnPage
specifically with how it handles regular expressions.Last known good working version is 1.1.6: https://github.com/mpetrovich/cypress-scenario-runner/blob/v1.1.6/src/behaviors.js#L65
Bug was introduced in 1.2.0: https://github.com/mpetrovich/cypress-scenario-runner/blob/v1.2.0/src/behaviors.js#L68
Steps to reproduce:
pages.js
or wherever you define your list of pages which uses a regular expression such as:'a profile': /\/profile\/\d+$/,
Note this is not a string holding a regular expression pattern, but is an actual RegEx object.Expected behavior: Asserting that the browser is "on" a particular page passes if the page's path matches a supplied regular expression pattern.
Observed behavior: Asserting that the browser is "on" a particular page fails with an exception when the given path is a regular expression. Stack trace below
Note: I tried temporarily switching to a string holding a regex pattern and the pattern would never match. Not sure if I did something wrong or if there is a further bug there.
The text was updated successfully, but these errors were encountered: