Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/helper/Playwright.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const ElementNotFound = require('./errors/ElementNotFound');
const RemoteBrowserConnectionRefused = require('./errors/RemoteBrowserConnectionRefused');
const Popup = require('./extras/Popup');
const Console = require('./extras/Console');
const findReact = require('./extras/React');
const findReact = require('./extras/PlaywrightReactVueLocator');

let playwright;
let perfTiming;
Expand Down
9 changes: 0 additions & 9 deletions lib/helper/extras/PlaywrightReact.js

This file was deleted.

32 changes: 32 additions & 0 deletions lib/helper/extras/PlaywrightReactVueLocator.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
module.exports = async function findReact(matcher, locator) {
let _locator = `_react=${locator.react}`;
let props = '';

if (locator.props) {
props += propBuilder(locator.props);
_locator += props;
}

return matcher.locator(_locator).all();
};

module.exports = async function findVue(matcher, locator) {
let _locator = `_vue=${locator.vue}`;
let props = '';

if (locator.props) {
props += propBuilder(locator.props);
_locator += props;
}

return matcher.locator(_locator).all();
};

function propBuilder(props) {
let _props = '';

for (const [key, value] of Object.entries(props)) {
_props += `[${key} = "${value}"]`;
}
return _props;
}
2 changes: 1 addition & 1 deletion typings/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ declare namespace CodeceptJS {
| string
| ILocator
| Locator
| CustomLocators[keyof CustomLocators];
| CustomLocators;

type StringOrSecret = string | CodeceptJS.Secret;

Expand Down