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

Add CLI command smashtest --init #86

Open
sarimarton opened this issue Aug 23, 2023 · 0 comments
Open

Add CLI command smashtest --init #86

sarimarton opened this issue Aug 23, 2023 · 0 comments

Comments

@sarimarton
Copy link
Collaborator

sarimarton commented Aug 23, 2023

The command is a general practice in the ecosystem, to name a few examples:

  • eslint --init
  • tsc --init
  • npm --init

Other test frameworks also typically provide some ways to generate a boilerplate with a few examples.

Smashtest is excellent in that it doesn't need much boilerplate, but

  1. there are technical nuances which severely impact the experience
  2. even a minimal example feels like a good idea

As for 1), there are 2 issues as of today:

  • Chrome v114+ has a major bug which prevents any meaningful browser tests:
    https://bugs.chromium.org/p/chromedriver/issues/detail?id=4532
    This can be worked around by specifying the browser version capability:

    Open browser
        // https://bugs.chromium.org/p/chromedriver/issues/detail?id=4532
        {browser version} = '113'
            Open Chrome
    

    It's a specific example which would fit well in an --init generated boilerplate.

  • Another issue is with the popular library start-server-and-test, which has a bug impacting only CLI testing programs. Despite the popularity of the library, it doesn't seem to be laboriously maintained. I have a patch for the bug, which could be applied with patch-package, but this is a tricky area. I can imagine that smashtest --init is an interactive shell, which asks about whether the user wants to use start-server-and-test and installs it along with patch-package and adds the patch.

    Another option would be if smashtest internally depended on start-server-and-test, and then it could apply the patch with patch-package with postinstall.

    The CLI of start-server-and-test is start-test <webserver command> <condition> <test command>

    This could be represented in smashtest as: smashtest --webserver-command=<webserver command>,<condition>

    I would lean towards integrating start-server-and-test into smashtest.

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

1 participant