Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for serenity-js with typescript 2.4.2 version #156

Closed
codesandtags opened this issue Jan 31, 2018 · 4 comments
Closed

Support for serenity-js with typescript 2.4.2 version #156

codesandtags opened this issue Jan 31, 2018 · 4 comments

Comments

@codesandtags
Copy link

@codesandtags codesandtags commented Jan 31, 2018

Currently, I'm using in serenity-js in a project and we had to upgrade the angular version to 5.2.0, but after that, it has some issues with the typescript version when I run the e2e test.

This is an example of the error that I get using typescript 2.4.2 and running the e2e test.

info: Serenity BDD CLI jar file is up to date :-)
WARNING: NODE_ENV value of 'test' did not match any deployment config file names.
WARNING: See https://github.com/lorenwest/node-config/wiki/Strict-Mode
(node:8344) [DEP0022] DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.
[13:56:28] I/launcher - Running 1 instances of WebDriver
[13:56:28] I/local - Starting selenium standalone server...
[13:56:29] I/local - Selenium standalone server started at http://10.236.216.61:64896/wd/hub
***Getting_Resolution***
 BROWSER SIZE {"height":807,"width":1051}
***The_Resolution_is:desktop***
⨯ Unable to compile TypeScript
Cannot find type definition file for 'chai'. (2688)
Cannot find type definition file for 'chai-as-promised'. (2688)
Cannot find type definition file for 'core-js'. (2688)
Cannot find type definition file for 'cucumber'. (2688)
Cannot find type definition file for 'grecaptcha'. (2688)
Cannot find type definition file for 'hammerjs'. (2688)
Cannot find type definition file for 'jasmine'. (2688)
Cannot find type definition file for 'jasminewd2'. (2688)
Cannot find type definition file for 'node'. (2688)
Cannot find type definition file for 'promises-a-plus'. (2688)
Cannot find type definition file for 'q'. (2688)
Cannot find type definition file for 'selenium-webdriver'. (2688)
e2e\features\support\world.ts (1,26): Cannot find module 'serenity-js'. (2307)
e2e\features\support\world.ts (2,24): Cannot find module '../../screenplay/actors'. (2307)
[13:56:34] I/local - Shutting down selenium standalone server.
[13:56:34] I/launcher - 0 instance(s) of WebDriver still running
[13:56:34] I/launcher - chrome #01 failed 1 test(s)
[13:56:34] I/launcher - overall: 1 failed spec(s)

After reviewing the issue with the versions, I've decided to update in my project the typescript version to 2.4.0 and finally, the e2e tests are running, however, I'm getting a warning message when I build the project using angular-cli.

@angular/compiler-cli@5.2.0 requires typescript@'>=2.4.2 <2.5.0' but 2.4.0 was found instead.
Using this version can result in undefined behaviour and difficult to debug problems.

Please run the following command to install a compatible version of TypeScript.

    npm install typescript@'>=2.4.2 <2.5.0'

To disable this warning run "ng set warnings.typescriptMismatch=false".

Is possible for this project, add compatibility to support at least the typescript 2.4.2 version in order to avoid the warning with angular 5 projects?

Thanks in advance,

Edwin Torres.

@jan-molak jan-molak mentioned this issue Feb 6, 2018
5 tasks
@jan-molak
Copy link
Member

@jan-molak jan-molak commented Feb 6, 2018

Thanks for reporting that, Edwin! The newer versions of TypeScript are a bit more strict on generics. SerenityBDDReporter needs to be improved so support those new rules. I'm planning to work on this shortly.

Thanks,
Jan

@codesandtags
Copy link
Author

@codesandtags codesandtags commented Feb 6, 2018

Thanks @jan-molak I'll be waiting for that.

Cheers and happy coding.
Edwin.

jan-molak added a commit that referenced this issue Jul 29, 2018
affects: @serenity-js/core

In order to enable improvements to various parts of Serenity/JS, I've decided to re-write the core
module.

ISSUES CLOSED: Closes #156, closes #105, partially addresses #162
@azimmalik
Copy link

@azimmalik azimmalik commented Oct 9, 2019

Is there any progress on this issue? I am having the same issue.

Thanks.

@jan-molak jan-molak added this to the 2.0 milestone Oct 14, 2019
@jan-molak
Copy link
Member

@jan-molak jan-molak commented Oct 14, 2019

@azimmalik - Serenity/JS v2 is transpiled using TypeScript 3.6. Since version 2 is going to supersede v1, the best way forward will be to upgrade to v2.

There's an example project available at https://github.com/serenity-js/serenity-js-cucumber-protractor-template and I'm working on documentation and an "official" release of v2 (currently in stable alpha) as we speak.

Hope this helps!
Jan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants