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
Use CodecepJS locate builder for managing of hierarchical elements as PageObject in a web testing framework for application with obfuscated(hashed) frontend class names where simplified code of subelement locator building could look like following:
locate('a').find('.n-a')
What do you get instead?
Exception on locate('a').find('.n-a')
-- FAILURES:
1) Web test playground
simple web test:
Error: Parse error on line 1:
.n-a
--^
Expecting 'EOF', ',', 'S', '>', '.', '#', '[', ']', '=', 'CONTAINS', 'DOES_NOT_CONTAIN', 'CONTAINS_WORD', 'CONTAINS_PREFIX', 'STARTS_WITH', 'ENDS_WITH', '~', '+', ':', 'ODD_ARGUMENT', 'EVEN_ARGUMENT', '(', ')', got '-'
at Parser.parseError (node_modules/bo-selector/parser.js:204:15)
at Parser.parse (node_modules/bo-selector/parser.js:262:22)
at parse (node_modules/css-to-xpath/js/css_to_xpath.js:12:23)
at convertToXpath (node_modules/css-to-xpath/js/css_to_xpath.js:15:16)
at Locator.toXPath (node_modules/codeceptjs/lib/locator.js:165:30)
at convertToSubSelector (node_modules/codeceptjs/lib/locator.js:509:47)
at Locator.find (node_modules/codeceptjs/lib/locator.js:188:53)
at Test.<anonymous> (tests/example-web-test.ts:11:17)
at Context.test.fn (node_modules/codeceptjs/lib/scenario.js:78:14)
or on locate('a').find('.n-6a')
-- FAILURES:
1) Web test playground
simple web test:
Error: Parse error on line 1:
.n-6a
--^
Expecting 'EOF', ',', 'S', '>', '.', '#', '[', ']', '=', 'CONTAINS', 'DOES_NOT_CONTAIN', 'CONTAINS_WORD', 'CONTAINS_PREFIX', 'STARTS_WITH', 'ENDS_WITH', '~', '+', ':', 'ODD_ARGUMENT', 'EVEN_ARGUMENT', '(', ')', got 'NEGATIVE_INTEGER'
at Parser.parseError (node_modules/bo-selector/parser.js:204:15)
at Parser.parse (node_modules/bo-selector/parser.js:262:22)
at parse (node_modules/css-to-xpath/js/css_to_xpath.js:12:23)
at convertToXpath (node_modules/css-to-xpath/js/css_to_xpath.js:15:16)
at Locator.toXPath (node_modules/codeceptjs/lib/locator.js:165:30)
at convertToSubSelector (node_modules/codeceptjs/lib/locator.js:509:47)
at Locator.find (node_modules/codeceptjs/lib/locator.js:188:53)
at Test.<anonymous> (tests/example-web-test.ts:11:17)
at Context.test.fn (node_modules/codeceptjs/lib/scenario.js:78:14)
Provide test source code if related
Feature('Web test playground');Scenario('simple web test',async({ I })=>{locate('a').find('.n-6a');});
Details
CodeceptJS version: 3.3.7
NodeJS Version: 14.21.2
Operating System:
puppeteer || webdriverio || testcafe version (if related)
The text was updated successfully, but these errors were encountered:
nikocanvacom
changed the title
Locator build is failing hyphen in class name eg locate('a').find('.n-a')
Locator build is failing on hyphen in css class names eg locate('a').find('.n-a')Jan 6, 2023
What are you trying to achieve?
Use CodecepJS locate builder for managing of hierarchical elements as PageObject in a web testing framework for application with obfuscated(hashed) frontend class names where simplified code of subelement locator building could look like following:
What do you get instead?
Exception on
locate('a').find('.n-a')
or on
locate('a').find('.n-6a')
Details
The text was updated successfully, but these errors were encountered: