diff --git a/.travis.yml b/.travis.yml index 2b999493c9..941cdbd7a6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,6 +16,8 @@ before_install: - echo $AUTHOR_NAME - export TZ=Europe/Brussels - npm i -g npm@6.4.1 + - NODE_VERSION="$(node -v)" + - echo $NODE_VERSION # This ensures that we are authenticated without requiring to have an actual .npmrc file within the project - 'echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >> ~/.npmrc' @@ -27,6 +29,7 @@ install: - if [[ ${TRAVIS_BRANCH} =~ ^greenkeeper.*$ || ${AUTHOR_NAME} == "greenkeeper[bot]" ]]; then npm run clean:modules:all; fi - if [[ ${TRAVIS_BRANCH} =~ ^greenkeeper.*$ || ${AUTHOR_NAME} == "greenkeeper[bot]" ]]; then npm i; else npm ci; fi - if [[ ${TRAVIS_BRANCH} =~ ^greenkeeper.*$ || ${AUTHOR_NAME} == "greenkeeper[bot]" ]]; then npm run install:travis:all; else npm run install:ci:all; fi + - if [[ ${TRAVIS_TAG} == "" && ${TRAVIS_EVENT_TYPE} != "cron" ]]; then npm run build:showcase:ghpages:ci-test-env; else npm run build:showcase:ghpages; fi env: global: @@ -45,14 +48,15 @@ cache: # Not needed since we use Puppeteer in karma.conf.ci.js # It downloads Chrome itself and works with or without Travis -#addons: # chrome: stable script: - npm run lint:all - npm run test:ci:all + # E2E tests only need to be run on 1 node version (v10) + # and the secure environmentals BROWSERSTACK_USERNAME, BROWSERSTACK_ACCESS_KEY should be set. (only on secure builds) + - if [[ ${NODE_VERSION} =~ ^v10.*$ && -n "${BROWSERSTACK_USERNAME}" && -n "${BROWSERSTACK_ACCESS_KEY}" ]]; then npm run test:showcase:e2e:browserstack; else echo "Skipping browserstack tests."; fi - npm run docs:coverage - - if [[ ${TRAVIS_TAG} == "" && ${TRAVIS_EVENT_TYPE} != "cron" ]]; then npm run build:showcase:ghpages:ci-test-env; else npm run build:showcase:ghpages; fi - npm run docs:publish - npm run release:publish - bash ./scripts/ci/print-logs.sh diff --git a/README.md b/README.md index c32a0d971f..33eb8bb3a1 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,7 @@ [![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/) [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier) [![License](https://img.shields.io/cocoapods/l/AFNetworking.svg)](LICENSE) [![Greenkeeper badge](https://badges.greenkeeper.io/NationalBankBelgium/stark.svg)](https://greenkeeper.io/) +[![BrowserStack Status](https://www.browserstack.com/automate/badge.svg?badge_key=dXkxd0JnL0V6TlRuVkszSGs5TDJscWFPOXdNL2hrMFdZREtMeEQ0SXU5RT0tLTBLZVJOb1JPR3pnUVhVY1NNMUtvdVE9PQ==--32b9d322c064334a80a3409239111be75d3d6ddd)](https://www.browserstack.com/automate/public-build/dXkxd0JnL0V6TlRuVkszSGs5TDJscWFPOXdNL2hrMFdZREtMeEQ0SXU5RT0tLTBLZVJOb1JPR3pnUVhVY1NNMUtvdVE9PQ==--32b9d322c064334a80a3409239111be75d3d6ddd) # Stark @@ -55,6 +56,8 @@ Stark's reusable build integrates support for: ## Developer guide +### [End-to-End Testing](docs/E2ETESTING.md) + TODO add links to developer guide sections ### Releases diff --git a/docs/E2ETESTING.md b/docs/E2ETESTING.md new file mode 100644 index 0000000000..768646dab2 --- /dev/null +++ b/docs/E2ETESTING.md @@ -0,0 +1,87 @@ +# End-to-End (E2E) Testing with Stark + +The Stark Starter comes with a setup to write and run end-to-end tests. + +## Protractor + +Protractor is an end-to-end test framework for Angular and AngularJS applications. Protractor runs tests against your application running in a real browser, interacting with it as a user would. + +For more information go to [https://www.protractortest.org](https://www.protractortest.org). + +### Running end-to-end tests + +Install all dependencies. + +```shell +npm run install:all +``` + +Build the application + +```shell +npm run build:starter +``` + +Run the end-to-end tests with protractor. _(make sure you have nothing running on `http://localhost:3000`)_ + +```shell +npm run test:starter:e2e +``` + +### Adding Tests + +If you add tests they should be added as `starter/e2e/src/[testSubset]/testName.e2e-spec.ts`. +They are automatically found here by the configuration of `specs` in the `packages/stark-testing/protractor.conf.js`. + +Keeping e2e tests separate like this prevents confusion when testing multiple components. + +## BrowserStack (optional) + +The showcase app uses Travis CI and BrowserStack to automatically run e2e-tests on multiple setups (Chrome, Firefox, IE, Safari, Android, IOS, ...). + +If you want to run your e2e-tests automatically on multiple setups one of the easiest solutions is BrowserStack. +They offer a free solution for open source projects. + +For more information go to [https://www.browserstack.com/automate](https://www.browserstack.com/automate). + +### Running end-to-end tests with BrowserStack + +#### Prerequisites + +- BrowserStack Account ([https://www.browserstack.com/](https://www.browserstack.com/)) + +#### Setup + +Find your credentials on the [BrowserStack dashboard](https://automate.browserstack.com/dashboard). + +Set the environmental `BROWSERSTACK_USERNAME` to the username and `BROWSERSTACK_ACCESS_KEY` to the access key. + +#### Run the tests + +```shell +npm run test:e2e:showcase:browserstack +``` + +_If you want to integrate BrowserStack in your own project you can have a look at `showcase/e2e/protractor.browserstack.conf.js` where we configured our setup._ + +_For more documentation see:_ + +- _[https://github.com/angular/protractor/blob/master/lib/config.ts](https://github.com/angular/protractor/blob/master/lib/config.ts)_ +- _[https://www.browserstack.com/automate/capabilities](https://www.browserstack.com/automate/capabilities)_ + +### Integrating BrowserStack with Travis CI + +To integrate the BrowserStack testing with Travis-CI simply add the same environmentals as before. **Remember to keep them private.** + +### Common errors + +#### Port busy + +```shell +LocalError: Either another browserstack local client is running on your machine or some server is listening on port 45691 +``` + +BrowserStack Local was probably not stopped properly on the last run. You can resolve this by manually terminating it. + +- MacOS: `pkill BrowserStack` +- Windows: Find the task in Task Manager and end it. diff --git a/package.json b/package.json index ffd99724fd..62ded4d9ad 100644 --- a/package.json +++ b/package.json @@ -69,6 +69,7 @@ "build:showcase": "cd showcase && npm run build:prod && cd ..", "build:showcase:ghpages": "cd showcase && npm run build:prod:ghpages && cd ..", "build:showcase:ghpages:ci-test-env": "cd showcase && npm run build:prod:ghpages:ci-test-env && cd ..", + "build:starter": "cd starter && npm run build && cd ..", "clean": "npx rimraf ./dist", "clean:all": "npm run clean && npm run clean:stark-build && npm run clean:stark-core && npm run clean:stark-ui && npm run clean:stark-testing && npm run clean:starter && npm run clean:showcase", "clean:stark-build": "cd packages/stark-build && npm run clean && cd ../..", @@ -138,8 +139,12 @@ "test:stark-core": "cd packages/stark-core && npm run test-fast && cd ../..", "test:stark-ui": "cd packages/stark-ui && npm run test-fast && cd ../..", "test:showcase": "cd showcase && npm run test-fast && cd ../..", + "test:showcase:e2e": "cd showcase && npm run e2e && cd ../..", + "test:showcase:e2e:browserstack": "cd showcase && npm run e2e:browserstack && cd ../..", "test:starter": "cd starter && npm run test-fast && cd ../..", - "test:ci:all": "npm run test:ci:stark-core && npm run test:ci:stark-ui && npm run test:ci:starter && npm run test:ci:showcase", + "test:starter:e2e": "cd starter && npm run e2e && cd ../..", + "test:starter:e2e:browserstack": "cd starter && npm run e2e:browserstack && cd ../..", + "test:ci:all": "npm run test:ci:stark-core && npm run test:ci:stark-ui && npm run test:ci:starter && npm run test:ci:starter", "test:ci:stark-core": "cd packages/stark-core && npm run test-fast:ci && cd ../..", "test:ci:stark-ui": "cd packages/stark-ui && npm run test-fast:ci && cd ../..", "test:ci:showcase": "cd showcase && npm run test-fast:ci && cd ../..", diff --git a/packages/stark-build/config-stark/protractor.conf.js b/packages/stark-build/config-stark/protractor.conf.js deleted file mode 100644 index a1d482eb0b..0000000000 --- a/packages/stark-build/config-stark/protractor.conf.js +++ /dev/null @@ -1,457 +0,0 @@ -"use strict"; - -// Helpers -const helpers = require("./helpers"); - -const fs = require("fs"); -const path = require("path"); - -// first we try to locate the Selenium jar file -const seleniumFolder = helpers.root("node_modules/protractor/node_modules/webdriver-manager/selenium"); -const seleniumFiles = fs.readdirSync(seleniumFolder); -let seleniumJarFile = ""; -for (let i in seleniumFiles) { - if (path.extname(seleniumFiles[i]) === ".jar") { - seleniumJarFile = seleniumFiles[i]; - break; - } -} -if (seleniumJarFile === null || seleniumJarFile === "") { - throw new Error( - "The Selenium jar file could not be located in [" + seleniumFolder + "]. Please make sure that Protractor is correctly installed!" - ); -} - -seleniumJarFile = path.join(seleniumFolder, seleniumJarFile); - -// since TS generates now ES2015 modules (to enable webpack tree-shaking) -// Protractor will fail to load the e2e.spec.ts files due to "Unexpected token 'import'..." -// So there are 2 possible solutions: -// 1.- transpile the tests with babel before running the tests (a bit complex and at the end we could not get this to work :( ) -// 2.- modify the TS config only for these E2E tests in order to generate CommonJS modules rather than ES2015 modules (we do this) -// -// so the TS config from the project (not the one from Stark!) is used but just changing the module type generation: CommonJS -const projectTsConfig = require(helpers.root("./tsconfig.json")); -// first we need to get all the compilerOptions (including those inherited from Stark) and just change the module type to CommonJS -const starkTsConfig = require(helpers.rootStark("./tsconfig.json")); -// IMPORTANT: also the "allowJs" option should be enabled so that the compiled JS code from Stark is transpiled as well -// otherwise if the .spec.ts files import something from Stark, ts-node will fail to load those files due to "Unexpected token 'import'..." -const compilerOptionsWithCommonJs = Object.assign({}, starkTsConfig.compilerOptions, projectTsConfig.compilerOptions, { - module: "commonjs", - allowJs: true -}); - -// Make sure that TS code can be loaded -// the compiler option "allowJs: true" is not enough, the code from Stark SHOULD be transpiled -// so the node_modules should be ignored EXCEPT those in @nationalbankbelgium -require("ts-node").register({ - compilerOptions: compilerOptionsWithCommonJs, - ignore: [/node_modules(?!\/@nationalbankbelgium)/] -}); - -exports.config = { - // --------------------------------------------------------------------------- - // ----- How to connect to Browser Drivers ----------------------------------- - // --------------------------------------------------------------------------- - // - // Protractor needs to know how to connect to Drivers for the browsers - // it is testing on. This is usually done through a Selenium Server. - // There are five options - specify one of the following: - // - // 1. seleniumServerJar - to start a standalone Selenium Server locally. - // 2. seleniumAddress - to connect to a Selenium Server which is already - // running. - // 3. sauceUser/sauceKey - to use remote Selenium Servers via Sauce Labs. - // 4. browserstackUser/browserstackKey - to use remote Selenium Servers via BrowserStack. - // 5. directConnect - to connect directly to the browser Drivers. - // This option is only available for Firefox and Chrome. - - // the version below MUST be aligned with the version specified in package.json in the pre-e2e script - // the version below MUST also be available on the server specified using the alternate_cdn option in the pre-e2e script in package.json - // ChromeDriver location is used to help find the chromedriver binary. - // This will be passed to the Selenium jar as the system property - // webdriver.chrome.driver. If null, Selenium will - // attempt to find ChromeDriver using PATH. - chromeDriver: "./node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_2.26.exe", - - // ---- 1. To start a standalone Selenium Server locally --------------------- - // The location of the standalone Selenium Server jar file, relative - // to the location of this config. If no other method of starting Selenium - // Server is found, this will default to - // node_modules/protractor/selenium/selenium-server... - seleniumServerJar: seleniumJarFile, - //seleniumPort: 4444 // default - - seleniumArgs: [ - // options (-help for details) - // the version below MUST be aligned with the version defined in the npm script - "-Dwebdriver.ie.driver=node_modules/protractor/node_modules/webdriver-manager/selenium/IEDriverServer_Win32_2.53.1.exe" - ], - - // Can be an object which will be passed to the SeleniumServer class as args. - // See a full list of options at - // https://github.com/SeleniumHQ/selenium/blob/master/javascript/node/selenium-webdriver/remote/index.js - // If you specify `args` or `port` in this object, it will overwrite the values - // set via the deprecated config values `seleniumPort` and `seleniumArgs`. - //localSeleniumStandaloneOpts: { - // The port to start the Selenium Server on, or null if the server should - // find its own unused port. - //port: null, - // Additional command line options to pass to selenium. For example, - // if you need to change the browser timeout, use - // seleniumArgs: ["-browserTimeout=60"] - //args: [] - //} - - // ---- 2. To connect to a Selenium Server which is already running ---------- - // The address of a running Selenium Server. If specified, Protractor will - // connect to an already running instance of Selenium. This usually looks like - // seleniumAddress: "http://localhost:4444/wd/hub" - //seleniumAddress: null, - - // The selenium session id allows Protractor to attach to an existing selenium - // browser session. The selenium session is maintained after the test has - // completed. Ignored if seleniumAddress is null. - //seleniumSessionId: null, - - // The address of a proxy server to use for the connection to the - // Selenium Server. If not specified no proxy is configured. Looks like - // webDriverProxy: "http://localhost:3128" - //webDriverProxy: null, - - // ---- 3. To use remote browsers via Sauce Labs ----------------------------- - // If sauceUser and sauceKey are specified, seleniumServerJar will be ignored. - // The tests will be run remotely using Sauce Labs. - //sauceUser: null, - //sauceKey: null, - // Use sauceAgent if you need customize agent for https connection to - // saucelabs.com (i.e. your computer behind corporate proxy) - //sauceAgent: null, - // Use sauceSeleniumAddress if you need to customize the URL Protractor - // uses to connect to sauce labs (for example, if you are tunneling selenium - // traffic through a sauce connect tunnel). Default is - // ondemand.saucelabs.com:80/wd/hub - //sauceSeleniumAddress: null, - - // ---- 4. To use remote browsers via BrowserStack --------------------------- - // If browserstackUser and browserstackKey are specified, seleniumServerJar will be ignored. - // The tests will be run remotely using BrowserStack. - //browserstackUser: null, - //browserstackKey: null, - - // ---- 5. To connect directly to Drivers ------------------------------------ - // Boolean. If true, Protractor will connect directly to the browser Drivers - // at the locations specified by chromeDriver and firefoxPath. Only Chrome - // and Firefox are supported for direct connect. - // directConnect: false, - - // Path to the firefox application binary. If null, will attempt to find - // firefox in the default locations. - //firefoxPath: null, - - // --------------------------------------------------------------------------- - // ----- What tests to run --------------------------------------------------- - // --------------------------------------------------------------------------- - - // Use default globals: "protractor", "brower", "$", "$$", "element", "by". - // These also exist as properties of the protractor namespace: - // "protractor.browser", "protractor.$", "protractor.$$", "protractor.element", - // "protractor.by", and "protractor.By". - // When no globals is set to true, the only available global variable will be - // "protractor". - //noGlobals: false, - - // Spec patterns are relative to the location of this config. - specs: [helpers.root("src") + "/**/**.e2e-spec.ts", helpers.root("src") + "/**/*.e2e-spec.ts"], - - // Patterns to exclude. - exclude: [], - - // Alternatively, suites may be used. When run without a command line - // parameter, all suites will run. If run with --suite=smoke or - // --suite=smoke,full only the patterns matched by the specified suites will - // run. - //suites: { - // smoke: "src/smoketests/**/*.e2e-spec.ts", - // full: "src/**/*.e2e-spec.ts" - //}, - - // If you would like protractor to use a specific suite by default instead of - // all suites, you can put that in the config file as well. - //suite: null, - - // --------------------------------------------------------------------------- - // ----- How to set up browsers ---------------------------------------------- - // --------------------------------------------------------------------------- - // - // Protractor can launch your tests on one or more browsers. If you are - // testing on a single browser, use the capabilities option. If you are - // testing on multiple browsers, use the multiCapabilities array. - - // For a list of available capabilities, see - // https://github.com/SeleniumHQ/selenium/wiki/DesiredCapabilities - // - // In addition, you may specify count, shardTestFiles, and maxInstances. - //capabilities: {}, - - // If you would like to run more than one instance of WebDriver on the same - // tests, use multiCapabilities, which takes an array of capabilities. - // If this is specified, capabilities will be ignored. - multiCapabilities: [ - { - browserName: "internet explorer", - platform: "ANY", - version: "11", - logName: "Internet Explorer " // the space is necessary because the version is added directly after - }, - - // the configuration below works if a Firefox version is available locally - { - browserName: "firefox", - logName: "Mozilla Firefox" - }, - - //{ - // "browserName": "MicrosoftEdge", - // logName: "Microsoft Edge", - //}, - - //{ - // "browserName": "safari", - // logName: "Safari", - //}, - - { - browserName: "chrome", - - chromeOptions: { - args: [ - "show-fps-counter=true", - // needed if your machine policy does not allow for Chrome extensions to be installed - // needed at the NBB - "disable-extensions" - ] - }, - - // Name of the process executing this capability. Not used directly by - // protractor or the browser, but instead pass directly to third parties - // like BrowserStack and SauceLabs as the name of the job running this test - //name: "End-to-end tests", - - // User defined name for the capability that will display in the results log - // Defaults to the browser name - logName: "Google Chrome" - - // Number of times to run this set of capabilities (in parallel, unless - // limited by maxSessions). Default is 1. - //count: 1, - - // If this is set to be true, specs will be sharded by file (i.e. all - // files to be run by this set of capabilities will run in parallel). - // Default is false. - //shardTestFiles: false, - - // Maximum number of browser instances that can run in parallel for this - // set of capabilities. This is only needed if shardTestFiles is true. - // Default is 1. - //maxInstances: 1, - - // Additional spec files to be run on this capability only. - //specs: ["spec/chromeOnlySpec.js"], - - // Spec files to be excluded on this capability only. - //exclude: ["spec/doNotRunInChromeSpec.js"], - - // Optional: override global seleniumAddress on this capability only. - //seleniumAddress: null, - - // Optional: Additional third-party specific capabilities can be - // specified here. - // For a list of BrowserStack specific capabilities, visit - // https://www.browserstack.com/automate/capabilities - } - ], - - // If you need to resolve multiCapabilities asynchronously (i.e. wait for - // server/proxy, set firefox profile, etc), you can specify a function here - // which will return either `multiCapabilities` or a promise to - // `multiCapabilities`. - // If this returns a promise, it is resolved immediately after - // `beforeLaunch` is run, and before any driver is set up. - // If this is specified, both capabilities and multiCapabilities will be - // ignored. - //getMultiCapabilities: null, - - // Maximum number of total browser sessions to run. Tests are queued in - // sequence if number of browser sessions is limited by this parameter. - // Use a number less than 1 to denote unlimited. Default is unlimited. - //maxSessions: -1, - - // --------------------------------------------------------------------------- - // ----- Global test information --------------------------------------------- - // --------------------------------------------------------------------------- - // - // A base URL for your application under test. Calls to protractor.get() - // with relative paths will be resolved against this URL (via url.resolve) - baseUrl: "http://localhost:8080/", - - // CSS Selector for the element housing the angular app - this defaults to - // body, but is necessary if ng-app is on a descendant of . - //rootElement: "body", - - // The timeout in milliseconds for each script run on the browser. This should - // be longer than the maximum time your application needs to stabilize between - // tasks. - allScriptsTimeout: 110000, - - // How long to wait for a page to load. - getPageTimeout: 20000, - - // A callback function called once configs are read but before any environment - // setup. This will only run once, and before onPrepare. - // You can specify a file containing code to run by setting beforeLaunch to - // the filename string. - beforeLaunch: function() { - // At this point, global variable "protractor" object will NOT be set up, - // and globals from the test framework will NOT be available. The main - // purpose of this function should be to bring up test dependencies. - }, - - // A callback function called once protractor is ready and available, and - // before the specs are executed. - // If multiple capabilities are being run, this will run once per - // capability. - // You can specify a file containing code to run by setting onPrepare to - // the filename string. - // onPrepare can optionally return a promise, which Protractor will wait for - // before continuing execution. This can be used if the preparation involves - // any asynchronous calls, e.g. interacting with the browser. Otherwise - // Protractor cannot guarantee order of execution and may start the tests - // before preparation finishes. - onPrepare: function() { - // At this point, global variable "protractor" object will be set up, and - // globals from the test framework will be available. For example, if you - // are using Jasmine, you can add a reporter with: - // jasmine.getEnv().addReporter(new jasmine.JUnitXmlReporter( - // "outputdir/", true, true)); - // - // If you need access back to the current configuration object, - // use a pattern like the following: - // return browser.getProcessedConfig().then(function(config) { - // // config.capabilities is the CURRENT capability being run, if - // // you are using multiCapabilities. - // console.log("Executing capability", config.capabilities); - // }); - browser.ignoreSynchronization = true; - }, - - // A callback function called once tests are finished. - // onComplete can optionally return a promise, which Protractor will wait for - // before shutting down webdriver. - onComplete: function() { - // At this point, tests will be done but global objects will still be - // available. - }, - - // A callback function called once the tests have finished running and - // the WebDriver instance has been shut down. It is passed the exit code - // (0 if the tests passed). This is called once per capability. - onCleanUp: function(exitCode) { - // ... - }, - - // A callback function called once all tests have finished running and - // the WebDriver instance has been shut down. It is passed the exit code - // (0 if the tests passed). afterLaunch must return a promise if you want - // asynchronous code to be executed before the program exits. - // This is called only once before the program exits (after onCleanUp). - afterLaunch: function(exitCode) {}, - - // The params object will be passed directly to the Protractor instance, - // and can be accessed from your test as browser.params. It is an arbitrary - // object and can contain anything you may need in your test. - // This can be changed via the command line as: - // --params.whatever.youwant "value" - params: { - // ... - }, - - // If set, protractor will save the test output in json format at this path. - // The path is relative to the location of this config. - //resultJsonOutputFile: null, - - // If true, protractor will restart the browser between each test. - // CAUTION: This will cause your tests to slow down drastically. - //restartBrowserBetweenTests: false, - - // Protractor will track outstanding $timeouts by default, and report them in - // the error message if Protractor fails to synchronize with Angular in time. - // In order to do this Protractor needs to decorate $timeout. - // CAUTION: If your app decorates $timeout, you must turn on this flag. This - // is false by default. - //untrackOutstandingTimeouts: false, - - // --------------------------------------------------------------------------- - // ----- The test framework -------------------------------------------------- - // --------------------------------------------------------------------------- - - // Test framework to use. This may be one of: - // jasmine, mocha or custom. - // - // When the framework is set to "custom" you'll need to additionally - // set frameworkPath with the path relative to the config file or absolute - // framework: "custom", - // frameworkPath: "./frameworks/my_custom_jasmine.js", - // See github.com/angular/protractor/blob/master/lib/frameworks/README.md - // to comply with the interface details of your custom implementation. - // - // Jasmine is fully supported as test and assertion frameworks. - // Mocha has limited support. You will need to include your - // own assertion framework (such as Chai) if working with Mocha. - framework: "jasmine", // jasmine - - // Options to be passed to jasmine. - // - // See https://github.com/jasmine/jasmine-npm/blob/master/lib/jasmine.js - // for the exact options available. - jasmineNodeOpts: { - // If true, print colors to the terminal. - showColors: true, - - // Show timing information - showTiming: true, - - // Verbose log - isVerbose: true, - - // Include stack traces - includeStackTrace: true, - - // Default time to wait in ms before a test fails. - defaultTimeoutInterval: 600000, - - // Function called to print jasmine results. - print: function() { - // ... - } - - // If set, only execute specs whose names match the pattern, which is - // internally compiled to a RegExp. - //grep: "pattern", - - // Inverts "grep" matches - //invertGrep: false, - } - - // See docs/plugins.md - //plugins: [], - - // Turns off source map support. Stops protractor from registering global - // variable `source-map-support`. Defaults to `false` - //skipSourceMapSupport: false, - - // Turns off WebDriver's environment variables overrides to ignore any - // environment variable and to only use the configuration in this file. - // Defaults to `false` - //disableEnvironmentOverrides: false, -}; diff --git a/packages/stark-build/config-stark/spec-bundle-stark.ts b/packages/stark-build/config-stark/spec-bundle-stark.ts deleted file mode 100644 index e2809aa778..0000000000 --- a/packages/stark-build/config-stark/spec-bundle-stark.ts +++ /dev/null @@ -1,67 +0,0 @@ -"use strict"; - -/* - * When testing with webpack and ES6, we have to do some extra - * things get testing to work right. Because we are gonna write test - * in ES6 to, we have to compile those as well. That's handled in - * karma.conf.js with the karma-webpack plugin. This is the entry - * file for webpack test. Just like webpack will create a bundle.js - * file for our client, when we run test, it well compile and bundle them - * all here! Crazy huh. So we need to do some setup - */ -// declare const require:any; -declare const __karma__: any; - -const path: any = require("path"); -const args: any = __karma__.config.args; -const opts: any = args ? args[0] : {}; - -// check if the user specified a specific test path -let testPath: string = opts.testPath; - -import "../src/polyfills-stark"; -import "../src/vendor-stark"; - -require("angular-mocks"); -require("angular-material/angular-material-mocks"); - -/* - Ok, this is kinda crazy. We can use the the context method on - require that webpack created in order to tell webpack - what files we actually want to require or import. - Below, context will be an function/object with file names as keys. - using that regex we are saying look in ../src then find - any file that ends with spec.ts and get its path. By passing in true - we say do this recursively - */ -const testsContext: any = require.context("../src", true, /\.spec\.ts$/); - -// do NOT delete any of the code below, it is necessary to load the unit tests -let modules: string[] = testsContext.keys(); - -// if so then we need to filter out test modules that do not match the provided file/folder path -if (testPath) { - testPath = testPath.toLocaleLowerCase(); - testPath = testPath.slice(7); - testPath = path.normalize(testPath); - //console.debug("Filtering the tests to execute. Test file paths must start with: ",testPath); - - modules = modules.filter((modulePath: string) => { - modulePath = modulePath.toLocaleLowerCase(); - modulePath = path.normalize(modulePath); - return modulePath.startsWith(testPath); // include this path only if it matches the given testPath - }); -} - -// load the tests -// using a for loop which is faster than forEach and for...of loops -/* tslint:disable:prefer-for-of */ -for (let idx: number = 0; idx < modules.length; ++idx) { - try { - testsContext(modules[idx]); - } catch (err) { - console.error("[ERROR] WITH SPEC FILE: ", modules[idx]); - console.error(err); - } -} -/* tslint:enable */ diff --git a/packages/stark-build/config-stark/spec-bundle.ts b/packages/stark-build/config-stark/spec-bundle.ts deleted file mode 100644 index a507f89948..0000000000 --- a/packages/stark-build/config-stark/spec-bundle.ts +++ /dev/null @@ -1,67 +0,0 @@ -"use strict"; - -/* - * When testing with webpack and ES6, we have to do some extra - * things get testing to work right. Because we are gonna write test - * in ES6 to, we have to compile those as well. That's handled in - * karma.conf.js with the karma-webpack plugin. This is the entry - * file for webpack test. Just like webpack will create a bundle.js - * file for our client, when we run test, it well compile and bundle them - * all here! Crazy huh. So we need to do some setup - */ -// declare const require:any; -declare const __karma__: any; - -const path: any = require("path"); -const args: any = __karma__.config.args; -const opts: any = args ? args[0] : {}; - -// check if the user specified a specific test path -let testPath: string = opts.testPath; - -import "../../../../src/polyfills"; -import "../../../../src/vendor"; - -require("angular-mocks"); -require("angular-material/angular-material-mocks"); - -/* - Ok, this is kinda crazy. We can use the the context method on - require that webpack created in order to tell webpack - what files we actually want to require or import. - Below, context will be an function/object with file names as keys. - using that regex we are saying look in ../src then find - any file that ends with spec.ts and get its path. By passing in true - we say do this recursively - */ -const testsContext: any = require.context("../../../../src", true, /\.spec\.ts$/); - -// do NOT delete any of the code below, it is necessary to load the unit tests -let modules: string[] = testsContext.keys(); - -// if so then we need to filter out test modules that do not match the provided file/folder path -if (testPath) { - testPath = testPath.toLocaleLowerCase(); - testPath = testPath.slice(7); - testPath = path.normalize(testPath); - //console.debug("Filtering the tests to execute. Test file paths must start with: ",testPath); - - modules = modules.filter((modulePath: string) => { - modulePath = modulePath.toLocaleLowerCase(); - modulePath = path.normalize(modulePath); - return modulePath.startsWith(testPath); // include this path only if it matches the given testPath - }); -} - -// load the tests -// using a for loop which is faster than forEach and for...of loops -/* tslint:disable:prefer-for-of */ -for (let idx: number = 0; idx < modules.length; ++idx) { - try { - testsContext(modules[idx]); - } catch (err) { - console.error("[ERROR] WITH SPEC FILE: ", modules[idx]); - console.error(err); - } -} -/* tslint:enable */ diff --git a/packages/stark-build/config-stark/spec-jasmine-stark.js b/packages/stark-build/config-stark/spec-jasmine-stark.js deleted file mode 100644 index c3c7b82dc4..0000000000 --- a/packages/stark-build/config-stark/spec-jasmine-stark.js +++ /dev/null @@ -1,89 +0,0 @@ -// This script provides a way to execute unit tests much faster than with Karma -// It uses the API of Jasmine to define the set of tests to execute and runs them simply using node -// This means that unit tests CANNOT rely on the Window object (i.e., Angular won't work) -// Thus this is only useful for actual unit tests :) -// To use this you can configure this script: "test-node": "node ./config/spec-jasmine-stark.js" - -const defaultSpecFiles = "**/*.spec.ts"; -// check if the user specified a specific test path -const specFiles = process.argv[2] ? process.argv[2] : defaultSpecFiles; -console.log("specFiles path: ", specFiles); - -const helpers = require("./helpers"); - -// Make sure that TS code can be loaded -// since TS generates now ES2015 modules (to enable webpack tree-shaking) -// ts-node will fail to load the .spec.ts files due to "Unexpected token 'import'..." -// So there are 2 possible solutions: -// 1.- transpile the tests with babel before running the tests (a bit complex and at the end we could not get this to work :( ) -// 2.- modify the TS config only for ts-node in order to generate CommonJS modules rather than ES2015 modules (we do this) -// -// so the TS config from the current project is used but just changing the module type generation: CommonJS -const projectTsConfig = require(helpers.root("./tsconfig.json")); -// first we need to get all the compilerOptions (including those inherited from Stark) and just change the module type to CommonJS -let starkTsConfig; -let compilerOptionsToOverwrite = { module: "commonjs" }; // change the module type generation to CommonJS -let tsNodeIgnoredFiles = [/node_modules/]; // the default in ts-node -try { - // the current project IS NOT Stark, it is an application project, then the Stark tsConfig is read - starkTsConfig = require(helpers.rootStark("./tsconfig.json")); - // IMPORTANT: in this case also the "allowJs" option should be enabled so that the compiled JS code from Stark is transpiled as well - // otherwise if the .spec.ts files import something from Stark, ts-node will fail to load those files due to "Unexpected token 'import'..." - compilerOptionsToOverwrite = Object.assign({}, compilerOptionsToOverwrite, { allowJs: true }); - // AND of course the code from Stark SHOULD be transpiled, so the node_modules should be ignored EXCEPT those in @nationalbankbelgium - tsNodeIgnoredFiles = [/node_modules(?!\/@nationalbankbelgium)/]; -} catch (e) { - // then the current project IS Stark, so the projectTsConfig variable already has the tsConfig from Stark - starkTsConfig = { compilerOptions: {} }; -} -const compilerOptionsWithCommonJs = Object.assign( - {}, - starkTsConfig.compilerOptions, - projectTsConfig.compilerOptions, - compilerOptionsToOverwrite -); -require("ts-node").register({ - compilerOptions: compilerOptionsWithCommonJs, - ignore: tsNodeIgnoredFiles -}); - -// stark typings need to be imported (the same as with TSC) -require("../src/typings/stark-typings"); - -global["ENV"] = "DEVELOPMENT"; -global["HMR"] = false; -global["PRODUCTION"] = false; -global["DEVELOPMENT"] = true; - -require("../src/polyfills-stark"); -//import "../src/vendor-stark"; -//require("angular-mocks"); - -const jasmine = require("jasmine"); -// TODO import reporters -// "jasmine-spec-reporter": "3.2.0", -//const jasmineSpecReporter:any = require("jasmine-spec-reporter"); - -const jasmineExec = new jasmine({ - projectBaseDir: helpers.root("") -}); - -jasmineExec.loadConfig({ - spec_dir: "src", - spec_files: [specFiles] -}); - -// TODO configure reporters -/* - const jasmineSpecReporterOptions:any = { - displayStacktrace: "all" - }; - - const initReporters:Function = () => { - jasmineExec.addReporter(new jasmineSpecReporter(jasmineSpecReporterOptions)); - }; - - initReporters(); - */ - -jasmineExec.execute(); diff --git a/packages/stark-build/config-stark/webpack.test.ci.js b/packages/stark-build/config-stark/webpack.test.ci.js deleted file mode 100644 index 493b6a7277..0000000000 --- a/packages/stark-build/config-stark/webpack.test.ci.js +++ /dev/null @@ -1,153 +0,0 @@ -"use strict"; - -const webpack = require("webpack"); - -//const webpackMerge = require("webpack-merge"); // Used to merge webpack configs -const commonConfig = require("./webpack.common.js"); // common configuration between environments -const commonData = require("./webpack.common-data.js"); // common configuration between environments - -// Webpack Plugins -const ExtractTextWebpackPlugin = require("extract-text-webpack-plugin"); -const DefinePlugin = require("webpack/lib/DefinePlugin"); -const HtmlWebpackPlugin = require("html-webpack-plugin"); -const LoaderOptionsPlugin = require("webpack/lib/LoaderOptionsPlugin"); - -// Helpers -const helpers = require("./helpers"); - -// Metadata -const METADATA = { - ENV: (process.env.ENV = process.env.NODE_ENV = "test"), - PRODUCTION: false, - DEVELOPMENT: true -}; - -/* - * Config - * reference: https://webpack.js.org/configuration/ - */ -module.exports = { - // Developer tool to enhance debugging - // reference: https://webpack.js.org/configuration/devtool - // reference: https://github.com/webpack/docs/wiki/build-performance#sourcemaps - devtool: "inline-source-map", - - // No caching for tests! - cache: false, - - stats: commonConfig.stats, - - // Options affecting the resolving of modules. - // reference: https://webpack.js.org/configuration/resolve - resolve: commonConfig.resolve, - - // Options affecting the normal modules. - // reference: https://webpack.js.org/configuration/module - module: { - // An array of applied loaders. - // IMPORTANT: The loaders here are resolved relative to the resource which they are applied to. - // This means they are not resolved relative to the configuration file. - // reference: https://webpack.js.org/configuration/module/#module-rules - rules: commonConfig.module.rules.concat([ - // Support for .ts files. - // reference: https://github.com/s-panferov/awesome-typescript-loader - { - test: /\.ts$/, - use: [ - { - loader: "babel-loader", - options: commonData.babel - }, - { - loader: "awesome-typescript-loader", - options: commonData.ts - } - ], - exclude: [ - /\.e2e-spec\.ts$/ // exclude end-to-end tests - ] - }, - - // instrument only testing sources with Istanbul - // reference: https://github.com/webpack-contrib/istanbul-instrumenter-loader - { - enforce: "post", - test: /\.(js|ts)$/, - include: helpers.root("src"), - use: { - loader: "istanbul-instrumenter-loader", - options: { esModules: true } - }, - exclude: [/\.e2e-spec\.ts$/, /\.spec\.ts$/, "node_modules"] - } - ]) - }, - - // Add additional plugins to the compiler. - // reference: https://webpack.js.org/plugins - plugins: [ - // Environment helpers (when adding more properties make sure you include them in environment.d.ts) - // Plugin: DefinePlugin - // Description: Define free variables. - // Useful for having development builds with debug logging or adding global constants. - // reference: https://webpack.js.org/plugins/define-plugin - // NOTE: when adding more properties make sure you include them in custom-typings.d.ts - new DefinePlugin({ - ENV: JSON.stringify(METADATA.ENV), - NODE_ENV: JSON.stringify(METADATA.ENV), - HMR: false, - PRODUCTION: METADATA.PRODUCTION, - DEVELOPMENT: METADATA.DEVELOPMENT, - "process.env": { - ENV: JSON.stringify(METADATA.ENV), - NODE_ENV: JSON.stringify(METADATA.ENV), - HMR: false, - PRODUCTION: METADATA.PRODUCTION, - DEVELOPMENT: METADATA.DEVELOPMENT - } - }), - - // Plugin: ExtractTextWebpackPlugin - // Description: Extract css file contents - // reference: https://github.com/webpack/extract-text-webpack-plugin - new ExtractTextWebpackPlugin({ - filename: "[name].[hash].css", - disable: false - }), - - // Plugin: HtmlWebpackPlugin - // Description: Simplifies creation of HTML files to serve your webpack bundles. - // This is especially useful for webpack bundles that include a hash in the filename - // which changes every compilation. - // reference: https://github.com/jantimon/html-webpack-plugin - new HtmlWebpackPlugin({ - template: helpers.root("src/index.html"), - chunksSortMode: helpers.packageSort(["polyfills", "vendor", "main"]), - metadata: METADATA, - inject: "body", // true (default) or "body" are the same - starkAppMetadata: {}, - starkAppConfig: {} - }), - - // reference: https://webpack.js.org/plugins/loader-options-plugin - new LoaderOptionsPlugin({ - // Switch loaders to debug mode - debug: true, - options: { - // No caching for tests! - cache: false, - - // TSLint configuration - // Static analysis linter for TypeScript advanced options configuration - // Description: An extensible linter for the TypeScript language. - // reference: https://github.com/wbuchwalter/tslint-loader - tslint: commonData.tslint.dev - } - }) - ], - - // Include polyfills or mocks for various node stuff - // Description: Node configuration - // reference: https://webpack.js.org/configuration/node - node: commonConfig.node -}; diff --git a/packages/stark-build/config-stark/webpack.test.js b/packages/stark-build/config-stark/webpack.test.js deleted file mode 100644 index 2628fb1725..0000000000 --- a/packages/stark-build/config-stark/webpack.test.js +++ /dev/null @@ -1,148 +0,0 @@ -"use strict"; - -const webpack = require("webpack"); - -//const webpackMerge = require("webpack-merge"); // Used to merge webpack configs -const commonConfig = require("./webpack.common.js"); // common configuration between environments -const commonData = require("./webpack.common-data.js"); // common configuration between environments - -// Webpack Plugins -const ExtractTextWebpackPlugin = require("extract-text-webpack-plugin"); -const DefinePlugin = require("webpack/lib/DefinePlugin"); -const HtmlWebpackPlugin = require("html-webpack-plugin"); -const LoaderOptionsPlugin = require("webpack/lib/LoaderOptionsPlugin"); -const SourceMapDevToolPlugin = require("webpack/lib/SourceMapDevToolPlugin"); - -// Helpers -const helpers = require("./helpers"); - -// Metadata -const METADATA = { - ENV: (process.env.ENV = process.env.NODE_ENV = "test"), - PRODUCTION: false, - DEVELOPMENT: true -}; - -/* - * Config - * reference: https://webpack.js.org/configuration/ - */ -module.exports = { - // Developer tool to enhance debugging - // reference: https://webpack.js.org/configuration/devtool - // reference: https://github.com/webpack/docs/wiki/build-performance#sourcemaps - devtool: "inline-source-map", - - // No caching for tests! - cache: false, - - stats: commonConfig.stats, - - // Options affecting the resolving of modules. - // reference: https://webpack.js.org/configuration/resolve - resolve: commonConfig.resolve, - - // Options affecting the normal modules. - // reference: https://webpack.js.org/configuration/module - module: { - // An array of applied loaders. - // IMPORTANT: The loaders here are resolved relative to the resource which they are applied to. - // This means they are not resolved relative to the configuration file. - // reference: https://webpack.js.org/configuration/module/#module-rules - rules: commonConfig.module.rules.concat([ - // Support for .ts files. - // reference: https://github.com/s-panferov/awesome-typescript-loader - { - test: /\.ts$/, - use: [ - { - loader: "babel-loader", - options: commonData.babel - }, - { - loader: "awesome-typescript-loader", - options: commonData.ts - } - ], - exclude: [ - /\.e2e-spec\.ts$/ // exclude end-to-end tests - ] - } - ]) - }, - - // Add additional plugins to the compiler. - // reference: https://webpack.js.org/plugins - plugins: [ - // reference: https://webpack.js.org/plugins/source-map-dev-tool-plugin/ - // reference: http://stackoverflow.com/questions/38344126/how-to-configure-karma-so-typescript-source-files-would-be-debuggable - new SourceMapDevToolPlugin({ - filename: null, // if no value is provided the sourcemap is inlined - test: /\.(ts|js)($|\?)/i // process .js and .ts files only - }), - - // Environment helpers (when adding more properties make sure you include them in environment.d.ts) - // Plugin: DefinePlugin - // Description: Define free variables. - // Useful for having development builds with debug logging or adding global constants. - // reference: https://webpack.js.org/plugins/define-plugin - // NOTE: when adding more properties make sure you include them in custom-typings.d.ts - new DefinePlugin({ - ENV: JSON.stringify(METADATA.ENV), - NODE_ENV: JSON.stringify(METADATA.ENV), - HMR: false, - PRODUCTION: METADATA.PRODUCTION, - DEVELOPMENT: METADATA.DEVELOPMENT, - "process.env": { - ENV: JSON.stringify(METADATA.ENV), - NODE_ENV: JSON.stringify(METADATA.ENV), - HMR: false, - PRODUCTION: METADATA.PRODUCTION, - DEVELOPMENT: METADATA.DEVELOPMENT - } - }), - - // Plugin: ExtractTextWebpackPlugin - // Description: Extract css file contents - // reference: https://github.com/webpack/extract-text-webpack-plugin - new ExtractTextWebpackPlugin({ - filename: "[name].[hash].css", - disable: false - }), - - // Plugin: HtmlWebpackPlugin - // Description: Simplifies creation of HTML files to serve your webpack bundles. - // This is especially useful for webpack bundles that include a hash in the filename - // which changes every compilation. - // reference: https://github.com/jantimon/html-webpack-plugin - new HtmlWebpackPlugin({ - template: helpers.root("src/index.html"), - chunksSortMode: helpers.packageSort(["polyfills", "vendor", "main"]), - metadata: METADATA, - inject: "body", // true (default) or "body" are the same - starkAppMetadata: {}, - starkAppConfig: {} - }), - - // reference: https://webpack.js.org/plugins/loader-options-plugin - new LoaderOptionsPlugin({ - // Switch loaders to debug mode - debug: true, - options: { - // No caching for tests! - cache: false, - - // TSLint configuration - // Static analysis linter for TypeScript advanced options configuration - // Description: An extensible linter for the TypeScript language. - // reference: https://github.com/wbuchwalter/tslint-loader - tslint: commonData.tslint.dev - } - }) - ], - - // Include polyfills or mocks for various node stuff - // Description: Node configuration - // reference: https://webpack.js.org/configuration/node - node: commonConfig.node -}; diff --git a/packages/stark-testing/package-lock.json b/packages/stark-testing/package-lock.json index 09c1108dcc..25d4dce494 100644 --- a/packages/stark-testing/package-lock.json +++ b/packages/stark-testing/package-lock.json @@ -111,6 +111,16 @@ "resolved": "https://registry.npmjs.org/@types/node/-/node-8.10.37.tgz", "integrity": "sha512-Jp39foY8Euv/PG4OGPyzxis82mnjcUtXLEMA8oFMCE4ilmuJgZPdV2nZNV1moz+99EJTtcpOSgDCgATUwABKig==" }, + "@types/q": { + "version": "0.0.32", + "resolved": "http://registry.npmjs.org/@types/q/-/q-0.0.32.tgz", + "integrity": "sha1-vShOV8hPEyXacCur/IKlMoGQwMU=" + }, + "@types/selenium-webdriver": { + "version": "3.0.14", + "resolved": "https://registry.npmjs.org/@types/selenium-webdriver/-/selenium-webdriver-3.0.14.tgz", + "integrity": "sha512-4GbNCDs98uHCT/OMv40qQC/OpoPbYn9XdXeTiFwHBBFO6eJhYEPUu2zDKirXSbHlvDV8oZ9l8EQ+HrEx/YS9DQ==" + }, "abbrev": { "version": "1.0.9", "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.0.9.tgz", @@ -130,6 +140,11 @@ "resolved": "https://registry.npmjs.org/acorn/-/acorn-4.0.13.tgz", "integrity": "sha1-EFSVrlNh1pe9GVyCUZLhrX8lN4c=" }, + "adm-zip": { + "version": "0.4.13", + "resolved": "https://registry.npmjs.org/adm-zip/-/adm-zip-0.4.13.tgz", + "integrity": "sha512-fERNJX8sOXfel6qCBCMPvZLzENBEhZTzKqg6vrOW5pvoEaQuJhRU4ndTAh6lHOxn1I6jnz2NHra56ZODM751uw==" + }, "after": { "version": "0.8.2", "resolved": "https://registry.npmjs.org/after/-/after-0.8.2.tgz", @@ -243,6 +258,19 @@ "resolved": "https://registry.npmjs.org/array-slice/-/array-slice-0.2.3.tgz", "integrity": "sha1-3Tz7gO15c6dRF82sabC5nshhhvU=" }, + "array-union": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", + "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", + "requires": { + "array-uniq": "^1.0.1" + } + }, + "array-uniq": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", + "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=" + }, "array-unique": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", @@ -253,6 +281,11 @@ "resolved": "https://registry.npmjs.org/arraybuffer.slice/-/arraybuffer.slice-0.0.7.tgz", "integrity": "sha512-wGUIVQXuehL5TCqQun8OW81jGzAWycqzFF8lFp+GOM5BXLYj3bKNsYC4daB7n6XjCqxQA/qgTJ+8ANR3acjrog==" }, + "arrify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", + "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=" + }, "asn1": { "version": "0.2.4", "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", @@ -440,6 +473,14 @@ "resolved": "https://registry.npmjs.org/blob/-/blob-0.0.5.tgz", "integrity": "sha512-gaqbzQPqOoamawKg0LGVd7SzLgXS+JH61oWprSLH+P+abTczqJbhTR8CmJ2u9/bUYNmHTGJx/UEmn6doAvvuig==" }, + "blocking-proxy": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/blocking-proxy/-/blocking-proxy-1.0.1.tgz", + "integrity": "sha512-KE8NFMZr3mN2E0HcvCgRtX7DjhiIQrwle+nSVJVC/yqFb9+xznHl2ZcoBp2L9qzkI4t4cBFJ1efXF8Dwi132RA==", + "requires": { + "minimist": "^1.2.0" + } + }, "bluebird": { "version": "3.5.3", "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.3.tgz", @@ -596,6 +637,14 @@ "pako": "~1.0.5" } }, + "browserstack": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/browserstack/-/browserstack-1.5.1.tgz", + "integrity": "sha512-O8VMT64P9NOLhuIoD4YngyxBURefaSdR4QdhG8l6HZ9VxtU7jc3m6jLufFwKA5gaf7fetfB2TnRJnMxyob+heg==", + "requires": { + "https-proxy-agent": "^2.2.1" + } + }, "buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.2.1.tgz", @@ -1122,6 +1171,20 @@ } } }, + "del": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/del/-/del-2.2.2.tgz", + "integrity": "sha1-wSyYHQZ4RshLyvhiz/kw2Qf/0ag=", + "requires": { + "globby": "^5.0.0", + "is-path-cwd": "^1.0.0", + "is-path-in-cwd": "^1.0.0", + "object-assign": "^4.0.1", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0", + "rimraf": "^2.2.8" + } + }, "delayed-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", @@ -1381,6 +1444,11 @@ "safe-buffer": "^5.1.1" } }, + "exit": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", + "integrity": "sha1-BjJjj42HfMghB9MKD/8aF8uhzQw=" + }, "expand-braces": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/expand-braces/-/expand-braces-0.1.2.tgz", @@ -2268,6 +2336,19 @@ "resolved": "https://registry.npmjs.org/globals/-/globals-11.9.0.tgz", "integrity": "sha512-5cJVtyXWH8PiJPVLZzzoIizXx944O4OmRro5MWKx5fT4MgcN7OfaMutPeaTdJCCURwbWdhhcCWcKIffPnmTzBg==" }, + "globby": { + "version": "5.0.0", + "resolved": "http://registry.npmjs.org/globby/-/globby-5.0.0.tgz", + "integrity": "sha1-69hGZ8oNuzMLmbz8aOrCvFQ3Dg0=", + "requires": { + "array-union": "^1.0.1", + "arrify": "^1.0.0", + "glob": "^7.0.3", + "object-assign": "^4.0.1", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0" + } + }, "graceful-fs": { "version": "4.1.15", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.15.tgz", @@ -2318,6 +2399,21 @@ "har-schema": "^2.0.0" } }, + "has-ansi": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", + "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", + "requires": { + "ansi-regex": "^2.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" + } + } + }, "has-binary2": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has-binary2/-/has-binary2-1.0.3.tgz", @@ -2473,6 +2569,11 @@ "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.12.tgz", "integrity": "sha512-GguP+DRY+pJ3soyIiGPTvdiVXjZ+DbXOxGpXn3eMvNW4x4irjqXm4wHKscC+TfxSJ0yw/S1F24tqdMNsMZTiLA==" }, + "immediate": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.0.6.tgz", + "integrity": "sha1-nbHb0Pr43m++D13V5Wu2BigN5ps=" + }, "indent-string": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-2.1.0.tgz", @@ -2500,6 +2601,11 @@ "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" }, + "ini": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", + "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==" + }, "inline-source-map": { "version": "0.6.2", "resolved": "https://registry.npmjs.org/inline-source-map/-/inline-source-map-0.6.2.tgz", @@ -2631,6 +2737,27 @@ } } }, + "is-path-cwd": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-1.0.0.tgz", + "integrity": "sha1-0iXsIxMuie3Tj9p2dHLmLmXxEG0=" + }, + "is-path-in-cwd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-path-in-cwd/-/is-path-in-cwd-1.0.1.tgz", + "integrity": "sha512-FjV1RTW48E7CWM7eE/J2NJvAEEVektecDBVBE5Hh3nM1Jd0kvhHtX68Pr3xsDf857xt3Y4AkwVULK1Vku62aaQ==", + "requires": { + "is-path-inside": "^1.0.0" + } + }, + "is-path-inside": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-1.0.1.tgz", + "integrity": "sha1-jvW33lBDej/cprToZe96pVy0gDY=", + "requires": { + "path-is-inside": "^1.0.1" + } + }, "is-plain-object": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", @@ -2841,11 +2968,33 @@ "handlebars": "^4.0.11" } }, + "jasmine": { + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/jasmine/-/jasmine-2.8.0.tgz", + "integrity": "sha1-awicChFXax8W3xG4AUbZHU6Lij4=", + "requires": { + "exit": "^0.1.2", + "glob": "^7.0.6", + "jasmine-core": "~2.8.0" + }, + "dependencies": { + "jasmine-core": { + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/jasmine-core/-/jasmine-core-2.8.0.tgz", + "integrity": "sha1-vMl5rh+f0FcB5F5S5l06XWPxok4=" + } + } + }, "jasmine-core": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/jasmine-core/-/jasmine-core-3.3.0.tgz", "integrity": "sha512-3/xSmG/d35hf80BEN66Y6g9Ca5l/Isdeg/j6zvbTYlTzeKinzmaTM4p9am5kYqOmE05D7s1t8FGjzdSnbUbceA==" }, + "jasminewd2": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/jasminewd2/-/jasminewd2-2.2.0.tgz", + "integrity": "sha1-43zwsX8ZnM4jvqcbIDk5Uka07E4=" + }, "js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", @@ -2896,6 +3045,53 @@ "verror": "1.10.0" } }, + "jszip": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/jszip/-/jszip-3.1.5.tgz", + "integrity": "sha512-5W8NUaFRFRqTOL7ZDDrx5qWHJyBXy6velVudIzQUSoqAAYqzSh2Z7/m0Rf1QbmQJccegD0r+YZxBjzqoBiEeJQ==", + "requires": { + "core-js": "~2.3.0", + "es6-promise": "~3.0.2", + "lie": "~3.1.0", + "pako": "~1.0.2", + "readable-stream": "~2.0.6" + }, + "dependencies": { + "core-js": { + "version": "2.3.0", + "resolved": "http://registry.npmjs.org/core-js/-/core-js-2.3.0.tgz", + "integrity": "sha1-+rg/uwstjchfpjbEudNMdUIMbWU=" + }, + "es6-promise": { + "version": "3.0.2", + "resolved": "http://registry.npmjs.org/es6-promise/-/es6-promise-3.0.2.tgz", + "integrity": "sha1-AQ1YWEI6XxGJeWZfRkhqlcbuK7Y=" + }, + "process-nextick-args": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz", + "integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M=" + }, + "readable-stream": { + "version": "2.0.6", + "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.0.6.tgz", + "integrity": "sha1-j5A0HmilPMySh4jaz80Rs265t44=", + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "~1.0.0", + "process-nextick-args": "~1.0.6", + "string_decoder": "~0.10.x", + "util-deprecate": "~1.0.1" + } + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "http://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" + } + } + }, "karma": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/karma/-/karma-3.1.3.tgz", @@ -3234,6 +3430,14 @@ "type-check": "~0.3.2" } }, + "lie": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/lie/-/lie-3.1.1.tgz", + "integrity": "sha1-mkNrLMd0bKWd56QfpGmz77dr2H4=", + "requires": { + "immediate": "~3.0.5" + } + }, "load-json-file": { "version": "1.1.0", "resolved": "http://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", @@ -3765,6 +3969,11 @@ "resolved": "http://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" }, + "path-is-inside": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", + "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=" + }, "path-type": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", @@ -3881,6 +4090,89 @@ "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==" }, + "protractor": { + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/protractor/-/protractor-5.4.1.tgz", + "integrity": "sha512-ORey5ewQMYiXQxcQohsqEiKYOg/r5yJoJbt0tuROmmgajdg/CA3gTOZNIFJncUVMAJIk5YFqBBLUjKVmQO6tfA==", + "requires": { + "@types/node": "^6.0.46", + "@types/q": "^0.0.32", + "@types/selenium-webdriver": "^3.0.0", + "blocking-proxy": "^1.0.0", + "browserstack": "^1.5.1", + "chalk": "^1.1.3", + "glob": "^7.0.3", + "jasmine": "2.8.0", + "jasminewd2": "^2.1.0", + "optimist": "~0.6.0", + "q": "1.4.1", + "saucelabs": "^1.5.0", + "selenium-webdriver": "3.6.0", + "source-map-support": "~0.4.0", + "webdriver-js-extender": "2.1.0", + "webdriver-manager": "^12.0.6" + }, + "dependencies": { + "@types/node": { + "version": "6.14.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-6.14.2.tgz", + "integrity": "sha512-JWB3xaVfsfnFY8Ofc9rTB/op0fqqTSqy4vBcVk1LuRJvta7KTX+D//fCkiTMeLGhdr2EbFZzQjC97gvmPilk9Q==" + }, + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" + }, + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=" + }, + "chalk": { + "version": "1.1.3", + "resolved": "http://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "requires": { + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "http://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=" + }, + "webdriver-manager": { + "version": "12.1.0", + "resolved": "https://registry.npmjs.org/webdriver-manager/-/webdriver-manager-12.1.0.tgz", + "integrity": "sha512-oEc5fmkpz6Yh6udhwir5m0eN5mgRPq9P/NU5YWuT3Up5slt6Zz+znhLU7q4+8rwCZz/Qq3Fgpr/4oao7NPCm2A==", + "requires": { + "adm-zip": "^0.4.9", + "chalk": "^1.1.1", + "del": "^2.2.0", + "glob": "^7.0.3", + "ini": "^1.3.4", + "minimist": "^1.2.0", + "q": "^1.4.1", + "request": "^2.87.0", + "rimraf": "^2.5.2", + "semver": "^5.3.0", + "xml2js": "^0.4.17" + } + } + } + }, "proxy-from-env": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.0.0.tgz", @@ -3892,9 +4184,9 @@ "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=" }, "psl": { - "version": "1.1.29", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.1.29.tgz", - "integrity": "sha512-AeUmQ0oLN02flVHXWh9sSJF7mcdFq0ppid/JkErufc3hGIV/AMa8Fo9VgDo/cT2jFdOWoFvHp90qqBH54W+gjQ==" + "version": "1.1.31", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.1.31.tgz", + "integrity": "sha512-/6pt4+C+T+wZUieKR620OpzN/LlnNKuWjy1iFLQ/UG35JqHlR/89MP1d96dUfkf6Dne3TuLQzOYEYshJ+Hx8mw==" }, "public-encrypt": { "version": "4.0.3", @@ -3939,6 +4231,11 @@ } } }, + "q": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/q/-/q-1.4.1.tgz", + "integrity": "sha1-VXBbzZPF82c1MMLCy8DCs63cKG4=" + }, "qjobs": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/qjobs/-/qjobs-1.2.0.tgz", @@ -4183,6 +4480,40 @@ "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, + "saucelabs": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/saucelabs/-/saucelabs-1.5.0.tgz", + "integrity": "sha512-jlX3FGdWvYf4Q3LFfFWS1QvPg3IGCGWxIc8QBFdPTbpTJnt/v17FHXYVAn7C8sHf1yUXo2c7yIM0isDryfYtHQ==", + "requires": { + "https-proxy-agent": "^2.2.1" + } + }, + "sax": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", + "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==" + }, + "selenium-webdriver": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/selenium-webdriver/-/selenium-webdriver-3.6.0.tgz", + "integrity": "sha512-WH7Aldse+2P5bbFBO4Gle/nuQOdVwpHMTL6raL3uuBj/vPG07k6uzt3aiahu352ONBr5xXh0hDlM3LhtXPOC4Q==", + "requires": { + "jszip": "^3.1.3", + "rimraf": "^2.5.4", + "tmp": "0.0.30", + "xml2js": "^0.4.17" + }, + "dependencies": { + "tmp": { + "version": "0.0.30", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.30.tgz", + "integrity": "sha1-ckGdSovn1s51FI/YsyTlk6cRwu0=", + "requires": { + "os-tmpdir": "~1.0.1" + } + } + } + }, "semver": { "version": "5.6.0", "resolved": "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz", @@ -4459,6 +4790,14 @@ "urix": "^0.1.0" } }, + "source-map-support": { + "version": "0.4.18", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.4.18.tgz", + "integrity": "sha512-try0/JqxPLF9nOjvSta7tVondkP5dwgyLDjVoyMDlmjugT2lRZ1OfsrYTkCd2hkDnJTKRbO/Rl3orm8vlsUzbA==", + "requires": { + "source-map": "^0.5.6" + } + }, "source-map-url": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz", @@ -5008,6 +5347,15 @@ "defaults": "^1.0.3" } }, + "webdriver-js-extender": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/webdriver-js-extender/-/webdriver-js-extender-2.1.0.tgz", + "integrity": "sha512-lcUKrjbBfCK6MNsh7xaY2UAUmZwe+/ib03AjVOpFobX4O7+83BUveSrLfU0Qsyb1DaKJdQRbuU+kM9aZ6QUhiQ==", + "requires": { + "@types/selenium-webdriver": "^3.0.0", + "selenium-webdriver": "^3.0.1" + } + }, "which": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", @@ -5036,6 +5384,20 @@ "ultron": "~1.1.0" } }, + "xml2js": { + "version": "0.4.19", + "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.19.tgz", + "integrity": "sha512-esZnJZJOiJR9wWKMyuvSE1y6Dq5LCuJanqhxslH2bxM6duahNZ+HMpCLhBQGZkbX6xRf8x1Y2eJlgt2q3qo49Q==", + "requires": { + "sax": ">=0.6.0", + "xmlbuilder": "~9.0.1" + } + }, + "xmlbuilder": { + "version": "9.0.7", + "resolved": "http://registry.npmjs.org/xmlbuilder/-/xmlbuilder-9.0.7.tgz", + "integrity": "sha1-Ey7mPS7FVlxVfiD0wi35rKaGsQ0=" + }, "xmlhttprequest-ssl": { "version": "1.5.5", "resolved": "https://registry.npmjs.org/xmlhttprequest-ssl/-/xmlhttprequest-ssl-1.5.5.tgz", diff --git a/packages/stark-testing/package.json b/packages/stark-testing/package.json index fe3f7d02f4..01367994eb 100644 --- a/packages/stark-testing/package.json +++ b/packages/stark-testing/package.json @@ -34,6 +34,7 @@ "karma-sourcemap-loader": "0.3.7", "karma-typescript": "3.0.13", "karma-typescript-angular2-transform": "1.0.2", + "protractor": "5.4.1", "puppeteer": "1.11.0" }, "scripts": { diff --git a/packages/stark-build/config/protractor.conf.js b/packages/stark-testing/protractor.conf.js similarity index 88% rename from packages/stark-build/config/protractor.conf.js rename to packages/stark-testing/protractor.conf.js index c59158c2ab..8cee69c289 100644 --- a/packages/stark-build/config/protractor.conf.js +++ b/packages/stark-testing/protractor.conf.js @@ -1,5 +1,5 @@ require("ts-node").register({ - project: "tsconfig.e2e.json" + project: "e2e/tsconfig.e2e.json" }); const helpers = require("./helpers"); @@ -10,7 +10,7 @@ exports.config = { /** * Use `npm run e2e` */ - specs: [helpers.root("src/**/**.e2e.ts"), helpers.root("src/**/*.e2e.ts")], + specs: [helpers.root("./e2e/src/**/**.e2e-spec.ts"), helpers.root("e2e/src/**/*.e2e-spec.ts")], exclude: [], framework: "jasmine2", diff --git a/showcase/e2e/protractor.browserstack.conf.js b/showcase/e2e/protractor.browserstack.conf.js new file mode 100644 index 0000000000..affab6da2e --- /dev/null +++ b/showcase/e2e/protractor.browserstack.conf.js @@ -0,0 +1,135 @@ +const browserstack = require("browserstack-local"); +const { BROWSERSTACK_USERNAME, BROWSERSTACK_ACCESS_KEY, TRAVIS_BUILD_NUMBER } = process.env; +const defaultConfig = require("../node_modules/@nationalbankbelgium/stark-testing/protractor.conf.js").config; + +/** + * Specifies the different capabilities for BrowserStack. + * Here you can configure what OS / Browser you want to run your tests on. + * See {@link https://www.browserstack.com/automate/capabilities} + * @type {*[]} + */ +const CAPABILITIES = [ + { + os: "Windows", + os_version: "10", + browserName: "IE", + browser_version: "11.0" + }, + { + os: "Windows", + os_version: "10", + browserName: "Edge" + }, + { + os: "Windows", + os_version: "10", + browserName: "Chrome" + }, + { + os: "Windows", + os_version: "10", + browserName: "Firefox" + }, + { + os: "OS X", + os_version: "Mojave", + browserName: "Safari" + }, + { + device: "iPhone X", + os_version: "11.0", + realMobile: "true", + browserName: "Safari" + }, + { + device: "iPad Pro 12.9", + realMobile: "true", + os_version: "11.4", + browserName: "Safari" + }, + { + device: "Google Pixel 2", + realMobile: "true", + os_version: "9.0", + browserName: "Chrome" + } +]; + +if (!BROWSERSTACK_USERNAME || !BROWSERSTACK_ACCESS_KEY) { + throw new Error( + "The environmentals 'BROWSERSTACK_USERNAME' and 'BROWSERSTACK_ACCESS_KEY' need to be set to run tests on BrowserStack." + ); +} + +/** + * Code to start BrowserStack local before start of test. + * @returns {Promise} + */ +const beforeLaunch = async () => { + console.log("Connecting to BrowserStack local..."); + + exports.bs_local = new browserstack.Local(); + await new Promise((resolve, reject) => + exports.bs_local.start({ key: BROWSERSTACK_ACCESS_KEY }, error => (error ? reject(error) : resolve())) + ); + + console.log("BrowserStack local is connected. Starting tests..."); +}; + +/** + * Code to stop BrowserStack local after end of test. + * @param exitCode + * @returns {Promise} + */ +const afterLaunch = async exitCode => { + console.log(`Tests finished with exit code ${exitCode}.`); + console.log("Stopping BrowserStack local..."); + await new Promise(resolve => exports.bs_local.stop(resolve)); + console.log("BrowserStack local stopped."); +}; + +/** + * The config object for protractor. @see {@link https://github.com/angular/protractor/blob/master/lib/config.ts} + * This combines the default config from stark-build and configurations needed to run on {@link https://automate.browserstack.com} + * @type {{[p: string]: *}} + */ +const config = { + ...defaultConfig, + /** + * Overwrites baseUrl of defaultConfig. + * This is used as the entry point for browser.get() in the tests. + * http://bs-local.com:3000 maps to localhost when tests are run in BrowserStack. + */ + baseUrl: "http://bs-local.com:3000", + + directConnect: false, + browserstackUser: BROWSERSTACK_USERNAME, + browserstackKey: BROWSERSTACK_ACCESS_KEY, + + /** + * commonCapabilities are copied over all items in the multiCapabilities array. + */ + commonCapabilities: { + "browserstack.local": "true", + "browserstack.debug": "true", + "browserstack.console": "errors", + "browserstack.networkLogs": "true", + + project: "Stark Showcase", + build: TRAVIS_BUILD_NUMBER ? `travis ${TRAVIS_BUILD_NUMBER}` : "local" + }, + + /** + * Specifies all the different environments in which the tests are ran. + */ + multiCapabilities: CAPABILITIES, + + beforeLaunch, + afterLaunch +}; + +exports.config = { + ...config, + // Map the common capabilities to all the multi capabilities + multiCapabilities: config.multiCapabilities.map(caps => ({ ...config.commonCapabilities, ...caps })) +}; diff --git a/showcase/e2e/protractor.conf.js b/showcase/e2e/protractor.conf.js new file mode 100644 index 0000000000..6459987c15 --- /dev/null +++ b/showcase/e2e/protractor.conf.js @@ -0,0 +1 @@ +exports.config = require("../node_modules/@nationalbankbelgium/stark-testing/protractor.conf").config; diff --git a/showcase/e2e/src/app.e2e-spec.ts b/showcase/e2e/src/app.e2e-spec.ts new file mode 100644 index 0000000000..d58d01cc6d --- /dev/null +++ b/showcase/e2e/src/app.e2e-spec.ts @@ -0,0 +1,18 @@ +import { browser, by, element, ElementFinder } from "protractor"; + +describe("General tests:", () => { + beforeAll(async () => { + await browser.get(""); + }); + + it("should have title 'Stark Showcase'", async () => { + const subject: string = await browser.driver.getTitle(); + const result: string = "Stark Showcase"; + expect(subject).toBe(result); + }); + + it("should have stark logo", () => { + const subject: ElementFinder = element(by.css(".stark-app-bar stark-app-logo")); + expect(subject.isPresent()).toBeTruthy("Unable to find logo"); + }); +}); diff --git a/starter/tsconfig.e2e.json b/showcase/e2e/tsconfig.e2e.json similarity index 62% rename from starter/tsconfig.e2e.json rename to showcase/e2e/tsconfig.e2e.json index 2c7b284162..0e7afc6855 100644 --- a/starter/tsconfig.e2e.json +++ b/showcase/e2e/tsconfig.e2e.json @@ -1,5 +1,5 @@ { - "extends": "./tsconfig.json", + "extends": "../tsconfig.json", "compilerOptions": { "module": "commonjs" } diff --git a/showcase/package-lock.json b/showcase/package-lock.json index 65cba31915..6ec7321efe 100644 --- a/showcase/package-lock.json +++ b/showcase/package-lock.json @@ -1776,8 +1776,8 @@ } }, "@nationalbankbelgium/stark-build": { - "version": "file:../dist/packages-dist/stark-build/nationalbankbelgium-stark-build-10.0.0-beta.1-6cd2225.tgz", - "integrity": "sha512-KipXCujwN2AQmdKHiUUGySy9gRqOLOWKUVchxY1A5l7lWVQWMk9wLQDiKh5hvB+bkQmp8Qb3L0+zsWs15/HSSQ==", + "version": "file:../dist/packages-dist/stark-build/nationalbankbelgium-stark-build-10.0.0-beta.1-2ed5292.tgz", + "integrity": "sha512-akU1XkW9cHT7Vwsd60RnEKsyRUIsKPyRGSBtz4W7BdrAh329qCF85Fe2SJaCZcum2ylWC7hHcsQUKYdRr1jHmg==", "dev": true, "requires": { "@angular-devkit/build-angular": "0.11.2", @@ -1856,8 +1856,8 @@ } }, "@nationalbankbelgium/stark-core": { - "version": "file:../dist/packages-dist/stark-core/nationalbankbelgium-stark-core-10.0.0-beta.1-6cd2225.tgz", - "integrity": "sha512-fcUHvHhPcYhfqYsxYTdR5oz4PcjRsitIrZiKz+kH1ddHBxrJiPYajYijwTLyhw1WkNJHJrY9HOa/g2kWkpsrWw==", + "version": "file:../dist/packages-dist/stark-core/nationalbankbelgium-stark-core-10.0.0-beta.1-2ed5292.tgz", + "integrity": "sha512-pezXIj5B/PeI2AyCKJ+nnojsVftAaHpTk4ZGq4+Ysbsf/hqM/L3hTjSMhOh61T+Wwssicjuus3hfWPmAWt5R/w==", "requires": { "@angularclass/hmr": "2.1.3", "@ng-idle/core": "6.0.0-beta.3", @@ -1879,8 +1879,8 @@ } }, "@nationalbankbelgium/stark-testing": { - "version": "file:../dist/packages-dist/stark-testing/nationalbankbelgium-stark-testing-10.0.0-beta.1-6cd2225.tgz", - "integrity": "sha512-r2jWVF5FLU8001bR3gykf9JflIDD+yllBDeEnzH8eTBUY8b7Rxi0+QKIYrP4RW7pb401uZP86peVT4dZPOwwIQ==", + "version": "file:../dist/packages-dist/stark-testing/nationalbankbelgium-stark-testing-10.0.0-beta.1-2ed5292.tgz", + "integrity": "sha512-Tz3AXG84XwYH7Zc1zLlUlr2/nmxAR4zBZOMr1YRU3cG5cerVGzvde4/C2yE8UHAc7RDcd9Pk69S3xPV/226Wmg==", "dev": true, "requires": { "@types/jasmine": "3.3.1", @@ -1897,6 +1897,7 @@ "karma-sourcemap-loader": "0.3.7", "karma-typescript": "3.0.13", "karma-typescript-angular2-transform": "1.0.2", + "protractor": "5.4.1", "puppeteer": "1.11.0" }, "dependencies": { @@ -1924,8 +1925,8 @@ } }, "@nationalbankbelgium/stark-ui": { - "version": "file:../dist/packages-dist/stark-ui/nationalbankbelgium-stark-ui-10.0.0-beta.1-6cd2225.tgz", - "integrity": "sha512-ZKP2xf8mksVwZHfdCrtkLTSObiRuDd6hjZjzZ5a8jUlm3dfG/zaLr9fEx50FVHkVwwwkkwEFqhSFhOzOmisrmQ==", + "version": "file:../dist/packages-dist/stark-ui/nationalbankbelgium-stark-ui-10.0.0-beta.1-2ed5292.tgz", + "integrity": "sha512-s4Qma+AsxULwKzpd0rDIaHrUyHqfW6LdyY5/7Tmz6XgnVZ8uWJ9MibPNR0fQdEO+WAfOzD4/q01URjEvTOYRwg==", "requires": { "@angular/material-moment-adapter": "7.1.1", "@mdi/angular-material": "3.2.89", @@ -2091,9 +2092,9 @@ "dev": true }, "@types/selenium-webdriver": { - "version": "3.0.13", - "resolved": "https://registry.npmjs.org/@types/selenium-webdriver/-/selenium-webdriver-3.0.13.tgz", - "integrity": "sha512-rI0LGoMiZGUM+tjDakQpwZOvcmQoubiJ7hxqrYU12VRxBuGGvOThxrBOU/QmJKlKg1WG6FMzuvcEyLffvVSsmw==", + "version": "3.0.14", + "resolved": "https://registry.npmjs.org/@types/selenium-webdriver/-/selenium-webdriver-3.0.14.tgz", + "integrity": "sha512-4GbNCDs98uHCT/OMv40qQC/OpoPbYn9XdXeTiFwHBBFO6eJhYEPUu2zDKirXSbHlvDV8oZ9l8EQ+HrEx/YS9DQ==", "dev": true }, "@types/tapable": { @@ -3611,6 +3612,19 @@ "https-proxy-agent": "^2.2.1" } }, + "browserstack-local": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/browserstack-local/-/browserstack-local-1.3.5.tgz", + "integrity": "sha512-vBOMeiC1fDd0aDSKKx3smDyPOIQWyTy63pNh9i3XEbeAW/GBaQt1bGse9P0tVxuLwTfq8dFJtMqSIAwHO1sdKA==", + "dev": true, + "requires": { + "https-proxy-agent": "^2.2.1", + "is-running": "^2.0.0", + "ps-tree": "^1.1.0", + "sinon": "^1.17.6", + "temp-fs": "^0.9.9" + } + }, "buffer": { "version": "4.9.1", "resolved": "http://registry.npmjs.org/buffer/-/buffer-4.9.1.tgz", @@ -6721,6 +6735,15 @@ "mime-types": "^2.1.12" } }, + "formatio": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/formatio/-/formatio-1.1.1.tgz", + "integrity": "sha1-XtPM1jZVEJc4NGXZlhmRAOhhYek=", + "dev": true, + "requires": { + "samsam": "~1.1" + } + }, "forwarded": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz", @@ -8972,6 +8995,12 @@ "integrity": "sha512-qgDYXFSR5WvEfuS5dMj6oTMEbrrSaM0CrFk2Yiq/gXnBvD9pMa2jGXxyhGLfvhZpuMZe18CJpFxAt3CRs42NMg==", "dev": true }, + "is-running": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-running/-/is-running-2.1.0.tgz", + "integrity": "sha1-MKc/9cw4VOT8JUkICen1q/jeCeA=", + "dev": true + }, "is-stream": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", @@ -10573,6 +10602,12 @@ "integrity": "sha1-4PyVEztu8nbNyIh82vJKpvFW+Po=", "dev": true }, + "lolex": { + "version": "1.3.2", + "resolved": "http://registry.npmjs.org/lolex/-/lolex-1.3.2.tgz", + "integrity": "sha1-fD2mL/yzDw9agKJWbKJORdigHzE=", + "dev": true + }, "longest": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz", @@ -14560,15 +14595,24 @@ "integrity": "sha1-0/wRS6BplaRexok/SEzrHXj19HY=", "dev": true }, + "ps-tree": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/ps-tree/-/ps-tree-1.2.0.tgz", + "integrity": "sha512-0VnamPPYHl4uaU/nSFeZZpR21QAWRz+sRv4iW9+v/GS/J5U5iZB5BNN6J0RMoOvdx2gWM2+ZFMIm58q24e4UYA==", + "dev": true, + "requires": { + "event-stream": "=3.3.4" + } + }, "pseudomap": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=" }, "psl": { - "version": "1.1.29", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.1.29.tgz", - "integrity": "sha512-AeUmQ0oLN02flVHXWh9sSJF7mcdFq0ppid/JkErufc3hGIV/AMa8Fo9VgDo/cT2jFdOWoFvHp90qqBH54W+gjQ==", + "version": "1.1.31", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.1.31.tgz", + "integrity": "sha512-/6pt4+C+T+wZUieKR620OpzN/LlnNKuWjy1iFLQ/UG35JqHlR/89MP1d96dUfkf6Dne3TuLQzOYEYshJ+Hx8mw==", "dev": true }, "public-encrypt": { @@ -15550,6 +15594,12 @@ "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, + "samsam": { + "version": "1.1.2", + "resolved": "http://registry.npmjs.org/samsam/-/samsam-1.1.2.tgz", + "integrity": "sha1-vsEf3IOp/aBjQBIQ5AF2wwJNFWc=", + "dev": true + }, "sass-graph": { "version": "2.2.4", "resolved": "https://registry.npmjs.org/sass-graph/-/sass-graph-2.2.4.tgz", @@ -16086,6 +16136,18 @@ } } }, + "sinon": { + "version": "1.17.7", + "resolved": "http://registry.npmjs.org/sinon/-/sinon-1.17.7.tgz", + "integrity": "sha1-RUKk9JugxFwF6y6d2dID4rjv4L8=", + "dev": true, + "requires": { + "formatio": "1.1.1", + "lolex": "1.3.2", + "samsam": "1.1.2", + "util": ">=0.10.3 <1" + } + }, "slash": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-1.0.0.tgz", @@ -17337,6 +17399,26 @@ } } }, + "temp-fs": { + "version": "0.9.9", + "resolved": "https://registry.npmjs.org/temp-fs/-/temp-fs-0.9.9.tgz", + "integrity": "sha1-gHFzBDeHByDpQxUy/igUNk+IA9c=", + "dev": true, + "requires": { + "rimraf": "~2.5.2" + }, + "dependencies": { + "rimraf": { + "version": "2.5.4", + "resolved": "http://registry.npmjs.org/rimraf/-/rimraf-2.5.4.tgz", + "integrity": "sha1-loAAk8vxoMhr2VtGJUZ1NcKd+gQ=", + "dev": true, + "requires": { + "glob": "^7.0.5" + } + } + } + }, "terser": { "version": "3.11.0", "resolved": "https://registry.npmjs.org/terser/-/terser-3.11.0.tgz", diff --git a/showcase/package.json b/showcase/package.json index f1a2915099..23a8cacc9c 100644 --- a/showcase/package.json +++ b/showcase/package.json @@ -54,6 +54,7 @@ "e2e:live": "npm-run-all -p -r server:prod:ci protractor:live", "e2e:travis": "npm-run-all -p -r server:prod:ci protractor:delay", "e2e": "npm-run-all -p -r server:prod:ci protractor", + "e2e:browserstack": "npm-run-all -p -r server:prod:ci protractor:browserstack", "github-deploy:dev": "npm run webpack -- --config node_modules/@nationalbankbelgium/stark-build/config/webpack.github-deploy.js --progress --profile --env.githubDev", "github-deploy:prod": "npm run webpack -- --config node_modules/@nationalbankbelgium/stark-build/config/webpack.github-deploy.js --progress --profile --env.githubProd", "github-deploy": "npm run github-deploy:dev", @@ -69,7 +70,8 @@ "precommit": "lint-staged", "prettier-check": "prettier **/*.{css,js,json,md,pcss,scss,ts} --write", "preversion": "npm test", - "protractor": "protractor", + "protractor": "protractor ./e2e/protractor.conf", + "protractor:browserstack": "protractor ./e2e/protractor.browserstack.conf.js", "protractor:delay": "sleep 3 && npm run protractor", "protractor:live": "protractor --elementExplorer", "rimraf": "npx rimraf", @@ -124,8 +126,8 @@ "@angular/platform-browser-dynamic": "7.1.1", "@angular/platform-server": "7.1.1", "@angular/router": "7.1.1", - "@nationalbankbelgium/stark-core": "file:../dist/packages-dist/stark-core/nationalbankbelgium-stark-core-10.0.0-beta.1-6cd2225.tgz", - "@nationalbankbelgium/stark-ui": "file:../dist/packages-dist/stark-ui/nationalbankbelgium-stark-ui-10.0.0-beta.1-6cd2225.tgz", + "@nationalbankbelgium/stark-core": "file:../dist/packages-dist/stark-core/nationalbankbelgium-stark-core-10.0.0-beta.1-2ed5292.tgz", + "@nationalbankbelgium/stark-ui": "file:../dist/packages-dist/stark-ui/nationalbankbelgium-stark-ui-10.0.0-beta.1-2ed5292.tgz", "@uirouter/visualizer": "6.0.2", "angular-in-memory-web-api": "0.7.0", "basscss": "8.0.10", @@ -141,12 +143,13 @@ }, "devDependencies": { "@compodoc/compodoc": "1.1.7", - "@nationalbankbelgium/stark-build": "file:../dist/packages-dist/stark-build/nationalbankbelgium-stark-build-10.0.0-beta.1-6cd2225.tgz", - "@nationalbankbelgium/stark-testing": "file:../dist/packages-dist/stark-testing/nationalbankbelgium-stark-testing-10.0.0-beta.1-6cd2225.tgz", + "@nationalbankbelgium/stark-build": "file:../dist/packages-dist/stark-build/nationalbankbelgium-stark-build-10.0.0-beta.1-2ed5292.tgz", + "@nationalbankbelgium/stark-testing": "file:../dist/packages-dist/stark-testing/nationalbankbelgium-stark-testing-10.0.0-beta.1-2ed5292.tgz", "@types/core-js": "2.5.0", "@types/hammerjs": "2.0.36", "@types/node": "8.10.37", "@types/webpack-env": "1.13.6", + "browserstack-local": "1.3.5", "cross-env": "^5.1.5", "find-root": "^1.1.0", "gh-pages": "2.0.1", @@ -154,7 +157,6 @@ "lint-staged": "8.1.0", "npm-run-all": "^4.1.3", "parse5": "^5.0.0", - "protractor": "^5.4.1", "rimraf": "2.6.2", "ts-node": "7.0.1", "tslib": "1.9.3", diff --git a/showcase/src/app/app.e2e.ts b/showcase/src/app/app.e2e.ts deleted file mode 100644 index aaf254ecc7..0000000000 --- a/showcase/src/app/app.e2e.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { browser, by, element } from "protractor"; -// tslint:disable-next-line:no-import-side-effect -import "tslib"; - -// FIXME: this tslint disable flag is due to a bug in 'no-identical-functions' rule (https://github.com/SonarSource/SonarTS/issues/676). Remove it once it is solved -// tslint:disable:no-identical-functions -describe("App", () => { - beforeEach(async () => { - await browser.get("/"); - }); - - it("should have a title", async () => { - const subject: string = await browser.getTitle(); - const result: string = "Stark Showcase"; - expect(subject).toEqual(result); - }); - - it("should have header", async () => { - const subject: boolean = await element(by.css("h1")).isPresent(); - const result: boolean = true; - expect(subject).toEqual(result); - }); - - it("should have ", async () => { - const subject: boolean = await element(by.css("app home")).isPresent(); - const result: boolean = true; - expect(subject).toEqual(result); - }); -}); diff --git a/starter/e2e/protractor.conf.js b/starter/e2e/protractor.conf.js new file mode 100644 index 0000000000..6459987c15 --- /dev/null +++ b/starter/e2e/protractor.conf.js @@ -0,0 +1 @@ +exports.config = require("../node_modules/@nationalbankbelgium/stark-testing/protractor.conf").config; diff --git a/starter/e2e/src/app.e2e-spec.ts b/starter/e2e/src/app.e2e-spec.ts new file mode 100644 index 0000000000..bd4cc659ad --- /dev/null +++ b/starter/e2e/src/app.e2e-spec.ts @@ -0,0 +1,40 @@ +import { browser, by, element, ElementFinder } from "protractor"; + +describe("General tests:", () => { + beforeAll(async () => { + await browser.get(""); + }); + + it("should have title 'Stark Starter'", async () => { + const subject: string = await browser.driver.getTitle(); + const result: string = "Stark Starter"; + expect(subject).toBe(result); + }); + + describe("Login flow:", () => { + it("should login when clicking first account", async () => { + const firstAccount: ElementFinder = element(by.css("stark-login-page ul li:first-child > a")); + expect(firstAccount.isPresent()).toBeTruthy("Unable to find login."); + + try { + await firstAccount.click(); + } catch (e) { + fail("Unable to click first account"); + } + + const logoutButton: ElementFinder = element(by.css(".stark-app-logout")); + expect(logoutButton.isPresent()).toBeTruthy("Unable to find logout button"); + }); + + it("should have stark logo", async () => { + const subject: ElementFinder = element(by.className("stark-app-logo")); + expect(subject.isPresent()).toBeTruthy("Unable to find logo"); + }); + + it("should have 'Stark Starter Application' as header", async () => { + const subject: ElementFinder = element(by.css(".stark-main-container h1")); + expect(subject.isPresent()).toBeTruthy("No h1 found"); + expect(await subject.getText()).toEqual("Stark Starter Application"); + }); + }); +}); diff --git a/starter/e2e/tsconfig.e2e.json b/starter/e2e/tsconfig.e2e.json new file mode 100644 index 0000000000..0e7afc6855 --- /dev/null +++ b/starter/e2e/tsconfig.e2e.json @@ -0,0 +1,6 @@ +{ + "extends": "../tsconfig.json", + "compilerOptions": { + "module": "commonjs" + } +} diff --git a/starter/package-lock.json b/starter/package-lock.json index a42ec2c641..bf40527bd4 100644 --- a/starter/package-lock.json +++ b/starter/package-lock.json @@ -1776,8 +1776,8 @@ } }, "@nationalbankbelgium/stark-build": { - "version": "file:../dist/packages-dist/stark-build/nationalbankbelgium-stark-build-10.0.0-beta.1-6cd2225.tgz", - "integrity": "sha512-KipXCujwN2AQmdKHiUUGySy9gRqOLOWKUVchxY1A5l7lWVQWMk9wLQDiKh5hvB+bkQmp8Qb3L0+zsWs15/HSSQ==", + "version": "file:../dist/packages-dist/stark-build/nationalbankbelgium-stark-build-10.0.0-beta.1-2ed5292.tgz", + "integrity": "sha512-akU1XkW9cHT7Vwsd60RnEKsyRUIsKPyRGSBtz4W7BdrAh329qCF85Fe2SJaCZcum2ylWC7hHcsQUKYdRr1jHmg==", "dev": true, "requires": { "@angular-devkit/build-angular": "0.11.2", @@ -1856,8 +1856,8 @@ } }, "@nationalbankbelgium/stark-core": { - "version": "file:../dist/packages-dist/stark-core/nationalbankbelgium-stark-core-10.0.0-beta.1-6cd2225.tgz", - "integrity": "sha512-fcUHvHhPcYhfqYsxYTdR5oz4PcjRsitIrZiKz+kH1ddHBxrJiPYajYijwTLyhw1WkNJHJrY9HOa/g2kWkpsrWw==", + "version": "file:../dist/packages-dist/stark-core/nationalbankbelgium-stark-core-10.0.0-beta.1-2ed5292.tgz", + "integrity": "sha512-pezXIj5B/PeI2AyCKJ+nnojsVftAaHpTk4ZGq4+Ysbsf/hqM/L3hTjSMhOh61T+Wwssicjuus3hfWPmAWt5R/w==", "requires": { "@angularclass/hmr": "2.1.3", "@ng-idle/core": "6.0.0-beta.3", @@ -1879,8 +1879,8 @@ } }, "@nationalbankbelgium/stark-testing": { - "version": "file:../dist/packages-dist/stark-testing/nationalbankbelgium-stark-testing-10.0.0-beta.1-6cd2225.tgz", - "integrity": "sha512-r2jWVF5FLU8001bR3gykf9JflIDD+yllBDeEnzH8eTBUY8b7Rxi0+QKIYrP4RW7pb401uZP86peVT4dZPOwwIQ==", + "version": "file:../dist/packages-dist/stark-testing/nationalbankbelgium-stark-testing-10.0.0-beta.1-2ed5292.tgz", + "integrity": "sha512-Tz3AXG84XwYH7Zc1zLlUlr2/nmxAR4zBZOMr1YRU3cG5cerVGzvde4/C2yE8UHAc7RDcd9Pk69S3xPV/226Wmg==", "dev": true, "requires": { "@types/jasmine": "3.3.1", @@ -1897,6 +1897,7 @@ "karma-sourcemap-loader": "0.3.7", "karma-typescript": "3.0.13", "karma-typescript-angular2-transform": "1.0.2", + "protractor": "5.4.1", "puppeteer": "1.11.0" }, "dependencies": { @@ -1924,8 +1925,8 @@ } }, "@nationalbankbelgium/stark-ui": { - "version": "file:../dist/packages-dist/stark-ui/nationalbankbelgium-stark-ui-10.0.0-beta.1-6cd2225.tgz", - "integrity": "sha512-ZKP2xf8mksVwZHfdCrtkLTSObiRuDd6hjZjzZ5a8jUlm3dfG/zaLr9fEx50FVHkVwwwkkwEFqhSFhOzOmisrmQ==", + "version": "file:../dist/packages-dist/stark-ui/nationalbankbelgium-stark-ui-10.0.0-beta.1-2ed5292.tgz", + "integrity": "sha512-s4Qma+AsxULwKzpd0rDIaHrUyHqfW6LdyY5/7Tmz6XgnVZ8uWJ9MibPNR0fQdEO+WAfOzD4/q01URjEvTOYRwg==", "requires": { "@angular/material-moment-adapter": "7.1.1", "@mdi/angular-material": "3.2.89", @@ -2091,9 +2092,9 @@ "dev": true }, "@types/selenium-webdriver": { - "version": "3.0.13", - "resolved": "https://registry.npmjs.org/@types/selenium-webdriver/-/selenium-webdriver-3.0.13.tgz", - "integrity": "sha512-rI0LGoMiZGUM+tjDakQpwZOvcmQoubiJ7hxqrYU12VRxBuGGvOThxrBOU/QmJKlKg1WG6FMzuvcEyLffvVSsmw==", + "version": "3.0.14", + "resolved": "https://registry.npmjs.org/@types/selenium-webdriver/-/selenium-webdriver-3.0.14.tgz", + "integrity": "sha512-4GbNCDs98uHCT/OMv40qQC/OpoPbYn9XdXeTiFwHBBFO6eJhYEPUu2zDKirXSbHlvDV8oZ9l8EQ+HrEx/YS9DQ==", "dev": true }, "@types/tapable": { @@ -14488,9 +14489,9 @@ "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=" }, "psl": { - "version": "1.1.29", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.1.29.tgz", - "integrity": "sha512-AeUmQ0oLN02flVHXWh9sSJF7mcdFq0ppid/JkErufc3hGIV/AMa8Fo9VgDo/cT2jFdOWoFvHp90qqBH54W+gjQ==", + "version": "1.1.31", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.1.31.tgz", + "integrity": "sha512-/6pt4+C+T+wZUieKR620OpzN/LlnNKuWjy1iFLQ/UG35JqHlR/89MP1d96dUfkf6Dne3TuLQzOYEYshJ+Hx8mw==", "dev": true }, "public-encrypt": { diff --git a/starter/package.json b/starter/package.json index 27d4786362..8279eb4b04 100644 --- a/starter/package.json +++ b/starter/package.json @@ -69,7 +69,7 @@ "precommit": "lint-staged", "prettier-check": "prettier **/*.{css,js,json,md,pcss,scss,ts} --write", "preversion": "npm test", - "protractor": "protractor", + "protractor": "protractor ./e2e/protractor.conf", "protractor:delay": "sleep 3 && npm run protractor", "protractor:live": "protractor --elementExplorer", "rimraf": "npx rimraf", @@ -124,8 +124,8 @@ "@angular/platform-browser-dynamic": "7.1.1", "@angular/platform-server": "7.1.1", "@angular/router": "7.1.1", - "@nationalbankbelgium/stark-core": "file:../dist/packages-dist/stark-core/nationalbankbelgium-stark-core-10.0.0-beta.1-6cd2225.tgz", - "@nationalbankbelgium/stark-ui": "file:../dist/packages-dist/stark-ui/nationalbankbelgium-stark-ui-10.0.0-beta.1-6cd2225.tgz", + "@nationalbankbelgium/stark-core": "file:../dist/packages-dist/stark-core/nationalbankbelgium-stark-core-10.0.0-beta.1-2ed5292.tgz", + "@nationalbankbelgium/stark-ui": "file:../dist/packages-dist/stark-ui/nationalbankbelgium-stark-ui-10.0.0-beta.1-2ed5292.tgz", "@uirouter/visualizer": "6.0.2", "core-js": "2.6.0", "eligrey-classlist-js-polyfill": "1.2.20180112", @@ -139,8 +139,8 @@ }, "devDependencies": { "@compodoc/compodoc": "1.1.7", - "@nationalbankbelgium/stark-build": "file:../dist/packages-dist/stark-build/nationalbankbelgium-stark-build-10.0.0-beta.1-6cd2225.tgz", - "@nationalbankbelgium/stark-testing": "file:../dist/packages-dist/stark-testing/nationalbankbelgium-stark-testing-10.0.0-beta.1-6cd2225.tgz", + "@nationalbankbelgium/stark-build": "file:../dist/packages-dist/stark-build/nationalbankbelgium-stark-build-10.0.0-beta.1-2ed5292.tgz", + "@nationalbankbelgium/stark-testing": "file:../dist/packages-dist/stark-testing/nationalbankbelgium-stark-testing-10.0.0-beta.1-2ed5292.tgz", "@types/core-js": "2.5.0", "@types/hammerjs": "2.0.36", "@types/node": "8.10.37", @@ -152,7 +152,6 @@ "lint-staged": "8.1.0", "npm-run-all": "^4.1.3", "parse5": "^5.0.0", - "protractor": "^5.4.1", "rimraf": "2.6.2", "ts-node": "7.0.1", "tslib": "1.9.3", diff --git a/starter/protractor.conf.js b/starter/protractor.conf.js deleted file mode 100644 index 9de36d4d64..0000000000 --- a/starter/protractor.conf.js +++ /dev/null @@ -1 +0,0 @@ -exports.config = require("./node_modules/@nationalbankbelgium/stark-build/config/protractor.conf.js").config; diff --git a/starter/src/app/app.e2e.ts b/starter/src/app/app.e2e.ts deleted file mode 100644 index 973cc6dc6c..0000000000 --- a/starter/src/app/app.e2e.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { browser, by, element } from "protractor"; -// tslint:disable-next-line:no-import-side-effect -import "tslib"; - -// FIXME: this tslint disable flag is due to a bug in 'no-identical-functions' rule (https://github.com/SonarSource/SonarTS/issues/676). Remove it once it is solved -// tslint:disable:no-identical-functions -describe("App", () => { - beforeEach(async () => { - await browser.get("/"); - }); - - it("should have a title", async () => { - const subject: string = await browser.getTitle(); - const result: string = "Stark Starter"; - expect(subject).toEqual(result); - }); - - it("should have header", async () => { - const subject: boolean = await element(by.css("h1")).isPresent(); - const result: boolean = true; - expect(subject).toEqual(result); - }); - - it("should have ", async () => { - const subject: boolean = await element(by.css("app home")).isPresent(); - const result: boolean = true; - expect(subject).toEqual(result); - }); -});