protractor icon indicating copy to clipboard operation
protractor copied to clipboard

angular 5, angular-cli, polyfills.ts and test.is is missing from the TypeScript compilation. add to tsconfig. But which?

Open maks187 opened this issue 8 years ago • 3 comments

Bug report

  • Node Version: v8.9.3

  • Protractor Version: Version 5.2.2

  • Angular Version: 5.2.0

  • Browser(s): Chrome

  • Operating System and Version Windows 10

  • Description:

doesn't run. it would be ok if the tests doesn't succeed, but when you point out that files are missing from compilation, WHY you don't say WHICH one it is and WHERE (the file-path) it is. How I suppose to know, how your framework is working under the hood? I'm only a user of it, not a developer. A compiler or framework has ALWAYS to point to the error, or it is completely useless!

  • Your protractor configuration file:
specs: [
    './src/main/typescript/e2e/**/*.e2e-spec.ts'
  ],

beforeLaunch: function() {
    require('ts-node').register({
      project: 'tsconfig.e2e.json'
    });
  },
  • Your protractor tsconfig.e2e.json file:
{
  "extends": "./tsconfig.json",
  "compilerOptions": {
    "outDir": "out-tsc/e2e",
    "module": "commonjs",
    "target": "es5",
    "types":[
      "jasmine",
      "node"
    ]
  },
  "include": [
    "./src/main/typescript/test.ts",
    "./src/main/typescript/polyfills.ts"
  ]
}
  • Steps to reproduce the bug

ng e2e

maks187 avatar Jun 08 '18 08:06 maks187

You have wrong specs path in your protractor configuration file. You should set path where you store *.js files. In your case it will be something like ../src/main/typescript/e2e/**/*.e2e-spec.js

CrispusDH avatar Jun 08 '18 08:06 CrispusDH

but my e2e-spec-file is an ts file:


import { AppMainPage } from './app.po';

describe('App', () => {
  let page: AppMainPage;

  beforeEach(() => {
    page = new AppMainPage();
  });

  it('plugin mod/com should exist', () => {
    page.navigateTo();
    expect<any>(page.getModElement()).toBeDefined();
  });

  // following tests.. it(...); ...

});

maks187 avatar Jun 13 '18 07:06 maks187

yes, I understand. firstly typescript compiles to javascript, and then javascript files run. You could read about "outDir": "out-tsc/e2e" in your tsconfig. So, in the protractor config file you should type a location of tests that have been already compile into js

CrispusDH avatar Jun 13 '18 16:06 CrispusDH