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

fix(#9): cannot start wdio tests #28

Closed
wants to merge 4 commits into from
Closed

fix(#9): cannot start wdio tests #28

wants to merge 4 commits into from

Conversation

Badisi
Copy link
Contributor

@Badisi Badisi commented Nov 9, 2021

Fix #9

@Badisi
Copy link
Contributor Author

Badisi commented Nov 9, 2021

@christian-bromann, to further improve this PR:

  1. I think we won't need this anymore : L164-L174 ? (and it was not even conditioned to isUsingTypeScript)

  2. We would need to add a default tsconfigFile value in angular.json L196:
    tsconfigFile: /test/tsconfig.e2e.json

    But I'm sure on how to get the /test here...

@christian-bromann
Copy link
Member

to further improve this PR:

seems reasonable, do you want to do this in a separate PR or in this one?

@Badisi
Copy link
Contributor Author

Badisi commented Nov 9, 2021

Any idea on how to elegantly get the parsedAnswers in here L188 ?

I need to do something like :

const relative = path.relative(process.cwd(), parsedAnswers.destSpecRootPath);
const tsconfigDir = relative.split(path.sep)[0];

const wdioConf = {
  builder: '@wdio/schematics:wdio',
  options: {
    devServerTarget: `${project}:serve`,
    tsconfigFile: `${tsconfigDir}/tsconfig.e2e.json`,
  },
  configurations: {
    production: {
      devServerTarget: `${project}:serve:production`
    }
  }
}

@christian-bromann
Copy link
Member

Shouldn't it be possible to store data in the SchematicContext object?

@Badisi
Copy link
Contributor Author

Badisi commented Nov 9, 2021

I don't think so...

And anyway runWizard and modifyAngularJson are running in a chain (L34) so we cannot make sure they both run in sequence. I will have to find a better way.

@Badisi
Copy link
Contributor Author

Badisi commented Nov 9, 2021

I won't be able to solve it without making many changes.

Running the wizard is optional so I cannot rely on the parsed answers that it returns.
The tsconfig file path has to be determined from within modifyAngularJson().
But this file could have been renamed or moved from a previous wizard installation, and so did the wdio configuration file.
So I'm kind of stuck here...

I guess the wizard shouldn't be optional (why would it be after all ?)
The schematics should decide itself whether wdio is already installed and install it if it's not or do nothing otherwise.
That way everything would be more predictable and easier to automate.

@Badisi
Copy link
Contributor Author

Badisi commented Nov 9, 2021

Unfortunately I'm acting blindely on this one because I was not able to mount this project locally to make the proper modifications.

I followed the development section in the README and it simply doesn't work.

$ npx ng add @wdio/schematics
> An unhandled exception occurred: Cannot find module '/Users/badisi/webdriverio-schematics-main/src/schematics/webdriverio/index'

@Badisi Badisi closed this by deleting the head repository Sep 16, 2022
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

Successfully merging this pull request may close these issues.

Cannot start wdio tests
2 participants