Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 2 additions & 2 deletions flutter-by/wdio-flutter-by-service/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion flutter-by/wdio-flutter-by-service/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "wdio-flutter-by-service",
"version": "1.0.13",
"version": "1.0.14",
"description": "",
"scripts": {
"build": "rimraf build && tsc -b",
Expand Down
8 changes: 5 additions & 3 deletions flutter-by/wdio-flutter-by-service/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,18 @@ import { command } from 'webdriver';
import { browser } from '@wdio/globals';
import path from 'path';
import { createRequire } from 'module';
import { pathToFileURL } from 'url';

const require = createRequire(import.meta.url);

const constructElementObject = async function () {
const wdioPath = require.resolve('webdriverio');
const pathToMatch = path.join('cjs', 'index.js');
const pathToReplace = path.join('utils', 'getElementObject.js');
return (
await import(path.join(wdioPath.replace(pathToMatch, ''), pathToReplace))
).getElement;
const targetPath = path.join(wdioPath.replace(pathToMatch, ''), pathToReplace);
const fileUrl = pathToFileURL(targetPath);

return (await import(fileUrl.href)).getElement;
};

const flutterElementFinder = function (
Expand Down
Loading