Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
js-frontend-tutorial js-frontend-tutorial
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • ci-general
  • js-frontend-tutorialjs-frontend-tutorial
  • Wiki
  • Configure e2e tests for gitlab runner

Configure e2e tests for gitlab runner · Changes

Page history
Create e2e tests runner authored Jul 11, 2019 by Taras Gaidukov's avatar Taras Gaidukov
Hide whitespace changes
Inline Side-by-side
Showing with 49 additions and 0 deletions
+49 -0
  • Configure-e2e-tests-for-gitlab-runner.md Configure-e2e-tests-for-gitlab-runner.md +49 -0
  • No files found.
Configure-e2e-tests-for-gitlab-runner.md 0 → 100644
View page @ 58af58cd
# Configure e2e tests for gitlab runner
1. Create another Protractor config file `e2e-tests/protractor-ci.conf.js` that will be used by gitlab-runner. In this configuration we will use `puppeteer` instead of usual Chrome browser:
e2e-tests/protractor-ci.conf.js
```
process.env.CHROME_BIN = process.env.CHROME_BIN || require('puppeteer').executablePath();
exports.config = {
allScriptsTimeout: 11000,
specs: [
'*.js'
],
exclude: [
'*.conf.js'
],
capabilities: {
browserName: 'chrome',
chromeOptions: {
args: ['--headless', '--no-sandbox'],
binary: process.env.CHROME_BIN
}
},
baseUrl: 'http://localhost:8000/',
framework: 'jasmine',
jasmineNodeOpts: {
defaultTimeoutInterval: 30000
}
};
```
2. Add `test-ci` and `http-server-ci` commands to `package.json`. We need to run http server as a background process:
```
"scripts": {
"test": "karma start karma.conf.js",
"protractor": "protractor e2e-tests/protractor.conf.js",
"start": "http-server . -a localhost -p 8000 -c-1",
"test-ci": "karma start karma-ci.conf.js",
"protractor-ci": "protractor e2e-tests/protractor-ci.conf.js",
"http-server-ci": "http-server . -a localhost -p 8000 -c-1 &"
},
```
3. Push changes to the repository, then you can see a new pipeline:
![e2e-pipeline](uploads/e1eb47f2820bbd85ffe55119ec68a72b/e2e-pipeline.png)
![e2e-passed](uploads/af1ae08455654761d292704b967ff081/e2e-passed.png)
\ No newline at end of file
Clone repository
  • A sample project
  • Build docker image
  • Configure GitLab CI
  • Configure e2e tests for gitlab runner
  • Configure e2e tests on local machine
  • Configure unit tests on local machine
  • Confirure unit tests for gitlab runner
  • Register gitlab runner
  • What is Continuous Integration
  • Home