Commit 09c96b90 authored by Florian Moser's avatar Florian Moser
Browse files

Add automatic deploy with cypress

parent 606efd46
Pipeline #84690 failed
stages:
- deploy
deploy:
image: node:9.11.1
only:
- master
script:
- cd automation
- yarn install --cache-folder .yarn
- yarn run cypress run --spec "cypress/integration/deploy.spec.js" --env username=$DEPLOY_USERNAME,password=$DEPLOY_PASSWORD
cache:
paths:
- automation/node_modules/
- automation/.yarn
\ No newline at end of file
cypress/videos/*
node_modules
cypress.env.json
\ No newline at end of file
{
"username": "username",
"password": "password"
}
\ No newline at end of file
/// <reference types="cypress" />
context('Actions', () => {
it('deploy', () => {
cy.visit('https://docker.thealternative.ch')
// login
cy.get('input[name=username]').type(Cypress.env('username'))
cy.get('input[name=password]').type(Cypress.env('password'))
cy.get('button[type=submit]').click()
// enter thealt area (first item)
cy.get('.blocklist-item').click()
// build new image
cy.get('a[href*="#!/1/docker/images"]').click()
cy.contains('Build a new image').click()
cy.get('input[ng-model="item.Name"]').eq(0).type('thealternative.ch:latest')
cy.contains('Specify a URL to a file').click()
cy.get('input[ng-model="formValues.URL"]').type('https://gitlab.ethz.ch/thealternative/website.git')
cy.contains('Build the image').click()
cy.contains('Image successfully built', { timeout: 30000 }).should('exist')
// publish new image
cy.get('a[href*="#!/1/docker/containers"]').click()
cy.contains('the-alternative-website').click()
cy.contains('Recreate').click()
cy.contains('Pull latest image').click()
cy.get('.bootbox-accept').click()
cy.contains('Container successfully re', { timeout: 30000 }).should('exist')
})
})
/// <reference types="cypress" />
// ***********************************************************
// This example plugins/index.js can be used to load plugins
//
// You can change the location of this file or turn off loading
// the plugins file with the 'pluginsFile' configuration option.
//
// You can read more here:
// https://on.cypress.io/plugins-guide
// ***********************************************************
// This function is called when a project is opened or re-opened (e.g. due to
// the project's config changing)
/**
* @type {Cypress.PluginConfig}
*/
module.exports = (on, config) => {
// `on` is used to hook into various events Cypress emits
// `config` is the resolved Cypress config
}
// ***********************************************
// This example commands.js shows you how to
// create various custom commands and overwrite
// existing commands.
//
// For more comprehensive examples of custom
// commands please read more here:
// https://on.cypress.io/custom-commands
// ***********************************************
//
//
// -- This is a parent command --
// Cypress.Commands.add("login", (email, password) => { ... })
//
//
// -- This is a child command --
// Cypress.Commands.add("drag", { prevSubject: 'element'}, (subject, options) => { ... })
//
//
// -- This is a dual command --
// Cypress.Commands.add("dismiss", { prevSubject: 'optional'}, (subject, options) => { ... })
//
//
// -- This will overwrite an existing command --
// Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... })
// ***********************************************************
// This example support/index.js is processed and
// loaded automatically before your test files.
//
// This is a great place to put global configuration and
// behavior that modifies Cypress.
//
// You can change the location of this file or turn off
// automatically serving support files with the
// 'supportFile' configuration option.
//
// You can read more here:
// https://on.cypress.io/configuration
// ***********************************************************
// Import commands.js using ES2015 syntax:
import './commands'
// Alternatively you can use CommonJS syntax:
// require('./commands')
{
"dependencies": {
"cypress": "^6.3.0"
},
"license": "MIT"
}
This diff is collapsed.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment