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

[Enhancement] Nightwatch Typescript Support #3322

Closed
31 tasks
vaibhavsingh97 opened this issue Aug 3, 2022 · 1 comment
Closed
31 tasks

[Enhancement] Nightwatch Typescript Support #3322

vaibhavsingh97 opened this issue Aug 3, 2022 · 1 comment
Labels
enhancement epic typescript Issues related to Typescript typescript-types-declaration Issues to related to Typescript types

Comments

@vaibhavsingh97
Copy link
Member

vaibhavsingh97 commented Aug 3, 2022

Currently, Typescript support in Nightwatch isn't great. For example, for a user to run a typescript project, firstly user needs to compile and then the user needs to run tests using Nightwatch CLI. So we wanted to fix the experience.

This is a list of Project that needs improvement.

Create Nightwatch

  • Use tsc –init for the new npm project, to create tsconfig config file
  • Add BDD test example
  • Creating Nightwatch.conf.ts for typescript projects (After Nightwatch release, which supports native typescript transpiling)
    • Refactoring of “Nightwatch.conf.ts” for typescript projects. Since it uses module.exports, which typescript understands but not the recommended way.

Nightwatch Typescript Boilerplate

  • Add BDD test example

Nightwatch Docs

  • Docs about writing and Organizing tests

    • What you will learn section
    • Folder structure for both Javascript and Typescript
    • Writing Tests
    • Running Tests
    • Test Status
    • Troubleshooting tests (Pause and Debug)
  • Docs for installing Typescript (Related PR: Add: guide for typescript setup nightwatch-docs#130)

    • Should talk about
      • Manual (Quick one)
        • Installing typescript and ts-node
        • Configuring tsconfig.json (recommended config and location of the config)
          • Note on Existing Nightwatch project can use typescript
      • Alternative way (recommended for new projects)
        • Using create-nightwatch tool
        • Talk about create-nightwatch to scaffold config and example tests

Nightwatch

  • Add support for nightwatch.conf.ts
    • New types for Nightwatch configuration in @types/nightwatch
  • Show relevant error message on CLI
    • ts-node is not present
    • ts-node failed to load
  • Load ts-node if project is using typescript
    • Read typescript config from nightwatch/tsconfig.json or tsconfig.nightwatch.json. Precedence will be given to nightwatch/tsconfig.json.
  • If the user is using Nightwatch in typescript project the old way (aka compiling)
    • Show the doc link to users that they can run typescript files directly
  • If the user already has ts-node installed and tsconfig file, then the user can run both typescript/javascript file
@vaibhavsingh97 vaibhavsingh97 added enhancement typescript Issues related to Typescript epic typescript-types-declaration Issues to related to Typescript types labels Aug 3, 2022
@vaibhavsingh97
Copy link
Member Author

Closing this issue, as all issues are linked in #3300

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement epic typescript Issues related to Typescript typescript-types-declaration Issues to related to Typescript types
Projects
None yet
Development

No branches or pull requests

1 participant