webdriverio / codemod

A codemod to transform Protractor into WebdriverIO tests
MIT License
25 stars 12 forks source link

[Protractor to WebdriverIO migration] Unable to transform Page Object file #60

Closed tusharbmc closed 2 years ago

tusharbmc commented 2 years ago

Hi Team,

I am unable to understand error. Could you please help me to fix attached page object file? (Remove .txt extension of the file, git is not allowing .ts file upload) create-case.po.ts.txt protractor.conf.js.txt

Command and Error log:

_C:\automation\webdriverIO\bwf-e2e-protractor-master>npx jscodeshift -t ./node_modules/@wdio/codemod/protractor ./e2e/test/specs/create-case.po.ts Processing 1 files... Spawning 1 workers... Sending 1 files to free worker... ERR ./e2e/test/specs/create-case.po.ts Transformation error (Unexpected token, expected "," (14:47)) SyntaxError: Unexpected token, expected "," (14:47) at instantiate (C:\automation\webdriverIO\bwf-e2e-protractor-master\node_modules\jscodeshift\node_modules\@babel\parser\src\parse-error\credentials.js:61:22) at toParseError (C:\automation\webdriverIO\bwf-e2e-protractor-master\node_modules\jscodeshift\node_modules\@babel\parser\src\parse-error.js:58:12) at Object.raise (C:\automation\webdriverIO\bwf-e2e-protractor-master\node_modules\jscodeshift\node_modules\@babel\parser\src\tokenizer\index.js:1763:19) at Object.unexpected (C:\automation\webdriverIO\bwf-e2e-protractor-master\node_modules\jscodeshift\node_modules\@babel\parser\src\tokenizer\index.js:1808:16) at Object.expect (C:\automation\webdriverIO\bwf-e2e-protractor-master\node_modules\jscodeshift\node_modules\@babel\parser\src\parser\util.js:153:28) at Object.parseBindingList (C:\automation\webdriverIO\bwf-e2e-protractor-master\node_modules\jscodeshift\node_modules\@babel\parser\src\parser\lval.js:397:14) at Object.parseFunctionParams (C:\automation\webdriverIO\bwf-e2e-protractor-master\node_modules\jscodeshift\node_modules\@babel\parser\src\parser\statement.js:1326:24) at Object.parseMethod (C:\automation\webdriverIO\bwf-e2e-protractor-master\node_modules\jscodeshift\node_modules\@babel\parser\src\parser\expression.js:2343:10) at Object.parseMethod (C:\automation\webdriverIO\bwf-e2e-protractor-master\node_modules\jscodeshift\node_modules\@babel\parser\src\plugins\estree.js:255:24) at Object.pushClassMethod (C:\automation\webdriverIO\bwf-e2e-protractor-master\node_modules\jscodeshift\nodemodules\@babel\parser\src\plugins\estree.js:171:12) All done. Results: 1 errors 0 unmodified 0 skipped 0 ok Time elapsed: 3.505seconds

christian-bromann commented 2 years ago

Duplicate of #28

This codemod doesn't fully transform typescript yet.

tusharbmc commented 2 years ago

@christian-bromann thanks for rapid response!