angular / protractor

E2E test framework for Angular apps
http://www.protractortest.org
MIT License
8.75k stars 2.31k forks source link

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

Open maks187 opened 6 years ago

maks187 commented 6 years ago

Bug report

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!

specs: [
    './src/main/typescript/e2e/**/*.e2e-spec.ts'
  ],

beforeLaunch: function() {
    require('ts-node').register({
      project: 'tsconfig.e2e.json'
    });
  },
{
  "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"
  ]
}

ng e2e

CrispusDH commented 6 years ago

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

maks187 commented 6 years ago

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(...); ...

});
CrispusDH commented 6 years ago

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