Skip to content

Commit

Permalink
simplify, use just regex
Browse files Browse the repository at this point in the history
  • Loading branch information
jonycoo committed Nov 14, 2024
1 parent c4b2f78 commit 7e0bfa5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion backend/features/step_definitions/stepdefs.js
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,7 @@ Then('So I will be navigated to the website: {string}', async function checkUrl(
const world = this;
try {
await driver.getCurrentUrl().then(async (currentUrl) => {
expect(currentUrl.replace(/\/$/, '') == url.trim().replace(/\/$/, '') , 'ERROR expected: ' + url.trim() + '; actual: ' + currentUrl).to.be.true
expect(currentUrl.replace(/\/$/g, '') == url.replace(/[\s]|\/\s*$/g, '') , 'ERROR expected: ' + url.replace(/[\s]|\/\s*$/g, '') + '; actual: ' + currentUrl.replace(/\/$/g, '')).to.be.true
});
} catch (e) {
await driver.takeScreenshot().then(async (buffer) => {
Expand Down

0 comments on commit 7e0bfa5

Please sign in to comment.