Skip to content

Avoid failure when API breaks #21

@berdal84

Description

@berdal84

When trying to translate from protractor to wdio v7, I had errors about API incompatibility (ex: browser.actions) not handled by the codemod. Instead of having a blocking error (with a lot of usefull information, which a good thing) I suggest:

  • To show a warning instead (with the same message and help links), to be able to finalize the auto conversion.
  • To comment the problematic lines (now it should compile).
  • To add a // TODO: you have to manually do this and that, because this and that.
  • To add an exception just before the lines, in order to be sure a developper will handle the conversion manually and can't run this test without a failure.

Let me give you an example:

Before:

    browser.actions()
         .mouseMove(element)
         .mouseMove({x: 200, y: 0})
         .perform();

After:

    throw new Error('You forgot to convert browser.actions(...), check source code at line:col ');
    // TODO: convert to wdio
    // <explanations here>
    //  browser.actions()
    //     .mouseMove(element)
    //     .mouseMove({x: 200, y: 0})
    //     .perform();

Regards,

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions