diff --git a/.github/workflows/mr.yml b/.github/workflows/mr.yml new file mode 100644 index 0000000..fd2b9d4 --- /dev/null +++ b/.github/workflows/mr.yml @@ -0,0 +1,25 @@ +name: Run Unit tests + +on: [push] + +jobs: + install-and-tests: + name: Installing dependencies and running tests + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [8.x, 10.x, 12.x] + + steps: + - name: Checkout repository + uses: actions/checkout@v1 + - uses: actions/setup-node@v1 + - name: Installing dependencies + run: npm install + - name: Running unit tests + run: npm run unit + - name: Running e2e tests + run: | + FIREFOX_BIN=/usr/bin/firefox npm run e2e-test + if [ "$(ls -A test/e2e/out)" ]; then echo "Not Empty"; else echo "Allure output directory is empty"; exit 1; fi \ No newline at end of file diff --git a/package.json b/package.json index 3a37b14..79e69a7 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "test": "npm run unit && npm run e2e-test", "unit": "jasmine JASMINE_CONFIG_PATH=test/jasmine.json", "e2e-clean": "rm -rf test/e2e/out", - "e2e-test": "npm run e2e-clean && node test/e2e/test-runner.js && allure generate -c test/e2e/out" + "e2e-test": "npm run e2e-clean && node test/e2e/test-runner.js" }, "dependencies": { "allure-js-commons": "1.3.2" diff --git a/src/AllureReporter.js b/src/AllureReporter.js index 8518554..4ac0d24 100644 --- a/src/AllureReporter.js +++ b/src/AllureReporter.js @@ -29,6 +29,7 @@ function AllureReporter(baseReporterDecorator, config) { return Math.max(stop, result.stop); }, Number.NEGATIVE_INFINITY); this.allure.endSuite(stopTime); + delete this.suites[suite]; }, this); }; diff --git a/test/e2e/test-runner.js b/test/e2e/test-runner.js index b75f44b..f9988ff 100644 --- a/test/e2e/test-runner.js +++ b/test/e2e/test-runner.js @@ -8,7 +8,7 @@ var karmaConfig = { ], port: 9876, colors: true, - browsers: ['PhantomJS', 'Firefox'], + browsers: ['PhantomJS', 'FirefoxHeadless'], captureTimeout: 60000, singleRun: true, @@ -19,6 +19,12 @@ var karmaConfig = { 'karma-phantomjs-launcher', 'karma-firefox-launcher' ], + customLaunchers: { + FirefoxHeadless: { + base: 'Firefox', + flags: [ '-headless' ], + }, + }, allureReport: { reportDir: 'out' } diff --git a/.travis.yml b/travis.yml similarity index 100% rename from .travis.yml rename to travis.yml