wswebcreation / wdio-ocr-service

Using Tesseract OCR with WebdriverIO and Appium Native App tests

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to make it work without wdio.conf.js ?

SABRYX opened this issue · comments

Describe your question with as much detail as possible
A clear and concise question that doesn't require too much conversation.

If it's about a specific piece of code, try and include some of it to support your question.
[...]

Environment (please complete the following information):

  • Node.js version: [e.g. 14.15.3]
  • NPM version: [e.g. 14.15.3]
  • Appium version: [e.g. 1.20.2]
  • Platform name and version: [e.g. Android 10]
  • WebdriverIO version: [e.g. 7.2.0]
  • wdio-ocr-service version: [e.g. 0.1.0]

Additional context
Add any other context about the problem here.

I'm using wdio like this:

const opts = {
	path: '/wd/hub',
	port: 4723,
	capabilities: {
		udid: '192.168.56.101:5555',
		platformName: 'Android',
		platformVersion: '10',
		appPackage: '',
		appActivity: '',
		automationName: 'UiAutomator2',
		noReset: true,
		fullReset: false,
		dontStopAppOnReset: false,
		test
	},
	services: ['ocr'],
};

async function main() {
	const driver = await wdio.remote(opts);
	driver.ocrClickOnText('Vende');

	await driver.deleteSession();
}

but it's not working it gives me
TypeError: driver.ocrClickOnText is not a function

I installed "wdio-ocr-service": "0.1.0" into my dev dependencies too

{
  "name": "apium",
  "version": "1.0.0",
  "main": "index.js",
  "license": "MIT",
  "dependencies": {
    "webdriverio": "^7.16.10"
  },
  "devDependencies": {
    "wdio-ocr-service": "0.1.0"
  }
}

Hi @SABRYX

Thanks for this question, the standalone runner of WDIO does not support services. You basically have no services, no plugins, not testrunner, no parallelism.
Going to close this but it's still open for discussion