E2e testing doing nothing since upgrade to ng7

165 views Asked by At

We just completed our upgrade to Angular 7 and since then, it does nothing any time we try to run e2e tests. It doesn't throw any errors, just doesn't do anything.

I tried booting up a completely new angular project and e2e tests work fine there. I copied over their angular.json file and just replaced the pathing and it does the same thing.

Everything else works perfectly. Unit tests, serve, and aot builds.

E2e output

Angular.json:

{
    "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
    "version": 1,
    "newProjectRoot": "projects",
    "projects": {
        "lscloud-ui": {
            "root": "",
            "sourceRoot": "source",
            "projectType": "application",
            "architect": {
                "build": {
                    "builder": "@angular-devkit/build-angular:browser",
                    "options": {
                        "outputPath": "build/build",
                        "index": "source/index.html",
                        "main": "source/main.ts",
                        "tsConfig": "source/tsconfig.app.json",
                        "showCircularDependencies": false,
                        "polyfills": "source/polyfills.ts",
                        "assets": [
                            "source/assets",
                            "source/favicon.ico"
                        ],
                        "styles": [],
                        "scripts": []
                    },
                    "configurations": {
                        "production": {
                            "optimization": true,
                            "outputHashing": "all",
                            "sourceMap": false,
                            "extractCss": true,
                            "namedChunks": false,
                            "aot": true,
                            "extractLicenses": true,
                            "vendorChunk": false,
                            "buildOptimizer": true,
                            "fileReplacements": [
                                {
                                    "replace": "source/environments/environment.ts",
                                    "with": "source/environments/environment.prod.ts"
                                }
                            ]
                        }
                    }
                },
                "serve": {
                    "builder": "@angular-devkit/build-angular:dev-server",
                    "options": {
                        "browserTarget": "lscloud-ui:build"
                    },
                    "configurations": {
                        "production": {
                            "browserTarget": "lscloud-ui:build:production"
                        }
                    }
                },
                "extract-i18n": {
                    "builder": "@angular-devkit/build-angular:extract-i18n",
                    "options": {
                        "browserTarget": "lscloud-ui:build"
                    }
                },
                "test": {
                    "builder": "@angular-devkit/build-angular:karma",
                    "options": {
                        "main": "source/test.ts",
                        "karmaConfig": "./karma.conf.js",
                        "polyfills": "source/polyfills.ts",
                        "tsConfig": "source/tsconfig.spec.json",
                        "scripts": [],
                        "styles": [],
                        "assets": [
                            "source/assets",
                            "source/favicon.ico"
                        ]
                    }
                },
                "lint": {
                    "builder": "@angular-devkit/build-angular:tslint",
                    "options": {
                        "tsConfig": [
                            "source/tsconfig.app.json"
                        ],
                        "exclude": [
                            "**/node_modules/**"
                        ]
                    }
                }
            }
        },
        "lscloud-ui-e2e": {
            "root": "",
            "sourceRoot": "",
            "projectType": "application",
            "architect": {
                "e2e": {
                    "builder": "@angular-devkit/build-angular:protractor",
                    "options": {
                        "protractorConfig": "./protractor.conf.js",
                        "devServerTarget": "lscloud-ui:serve",
                        "port": 49152
                    },
                    "configurations": {
                        "production": {
                            "devServerTarget": "lscloud-ui:serve:production"
                        }
                    }
                },
                "lint": {
                    "builder": "@angular-devkit/build-angular:tslint",
                    "options": {
                        "tsConfig": [
                            "e2e/tsconfig.e2e.json"
                        ],
                        "exclude": []
                    }
                }
            }
        }
    },
    "defaultProject": "lscloud-ui",
    "schematics": {
        "@schematics/angular:component": {
            "prefix": "",
            "styleext": "css"
        },
        "@schematics/angular:directive": {
            "prefix": ""
        }
    }
}

protractor.conf.js

const { SpecReporter } = require('jasmine-spec-reporter');

exports.config = {
    allScriptsTimeout: 11000,
    specs: [
        './e2e/**/*.e2e-spec.ts'
    ],
    capabilities: {
        'browserName': 'chrome'
    },
    directConnect: true,
    baseUrl: 'http://localhost:8081/',
    framework: 'jasmine',
    // capabilities: {
    //   'browserName': 'chrome',
    //   'chromeOptions': {
    //     'args': [ "--headless", "--disable-gpu", "--window-size=800x600" ]
    //   }
    // },
    jasmineNodeOpts: {
        showColors: true,
        defaultTimeoutInterval: 30000,
        print: function () { }
    },
    onPrepare() {
        browser.manage().window().setSize(1920, 1080);
        browser.ignoreSynchronization = true;
        require('ts-node').register({
            project: 'e2e/tsconfig.e2e.json'
        });
        jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
    },
    // seleniumAddress: 'http://localhost:4444/wd/hub',
    // seleniumSessionId: '82d468f7f7336afd5727cd8682c252eb',

    SELENIUM_PROMISE_MANAGER: false,
};
0

There are 0 answers