Unverified Commit 5124c613 authored by Ray Schamp's avatar Ray Schamp Committed by GitHub

Merge pull request #1910 from LLK/travis

Run smoke tests with Travis after deployment
parents 963a1898 ecd3f673
...@@ -18,6 +18,12 @@ env: ...@@ -18,6 +18,12 @@ env:
- API_HOST_VAR=API_HOST_$TRAVIS_BRANCH - API_HOST_VAR=API_HOST_$TRAVIS_BRANCH
- API_HOST=${!API_HOST_VAR} - API_HOST=${!API_HOST_VAR}
- API_HOST=${API_HOST:-$API_HOST_STAGING} - API_HOST=${API_HOST:-$API_HOST_STAGING}
- ROOT_URL_master=https://scratch.mit.edu
- ROOT_URL_STAGING=https://scratch.ly
- ROOT_URL_VAR=ROOT_URL_$TRAVIS_BRANCH
- ROOT_URL=${!ROOT_URL_VAR}
- ROOT_URL=${ROOT_URL:-$ROOT_URL_STAGING}
- PATH=$PATH:$PWD/test/integration/node_modules/chromedriver/bin
# EB_AWS_ACCESS_KEY_ID # EB_AWS_ACCESS_KEY_ID
- secure: A138rYuXDsOmpEwYxZ31WyXEeq5fgr9qyqsQh1nTFsjBKpFtNM+CN9e0QJQFT3PLs4wH/lWTRSyHxakxKQS1sxq828f9gHed+f15REKk/fRUplcCYIexT9xKVtU3D8CRNn/KBFWk75fZyZt20eyOVIv4h3pInKQz7y84J6PWzB1BCrAFvADrzS1X68Z3NJJLyxnz0YEurzz8mC2v4D0s/XifKTWvRtefD4QM6pE0C2iYyk+ThrLwg7i9FDHVfo0MrkgcdX7mz37SnTr7p7mHWnGXrGngi/NiDRQ+Uwwq/sr2UIww0rCwS1xsOcS//dC4NNqrrt1kUTsoC1Yt87Ny+gI0nUplsfEpdKajAkOYdANC5bJUGqPdSlOds1v9aJs9Hx48uGamWkm/3cFmoJ5uA2ZzUwbSGjTkWbnhwzT0YRvcLGhP1WE/EswaIyK5qMp522E79mP1yH6M750iUvi4N39+QW1BNX3ADkOwyAI67ArX5on5gWP83RXcJ15im7XsBpsmVn/KXi6AouWPb8jmSmKCj0QZCzfLY7ivM42IugYpK2NV7kFB38DpXQamJ5eskgwYa3elRmednIFUuwb1QDnONvJogVjk4CLmoSxssC2mJnnrUItM7l8G6As81GMI+6lTtl86hAuXBjUk60FMbgTAQDX9ll26LgpBy8jHSx8= - secure: A138rYuXDsOmpEwYxZ31WyXEeq5fgr9qyqsQh1nTFsjBKpFtNM+CN9e0QJQFT3PLs4wH/lWTRSyHxakxKQS1sxq828f9gHed+f15REKk/fRUplcCYIexT9xKVtU3D8CRNn/KBFWk75fZyZt20eyOVIv4h3pInKQz7y84J6PWzB1BCrAFvADrzS1X68Z3NJJLyxnz0YEurzz8mC2v4D0s/XifKTWvRtefD4QM6pE0C2iYyk+ThrLwg7i9FDHVfo0MrkgcdX7mz37SnTr7p7mHWnGXrGngi/NiDRQ+Uwwq/sr2UIww0rCwS1xsOcS//dC4NNqrrt1kUTsoC1Yt87Ny+gI0nUplsfEpdKajAkOYdANC5bJUGqPdSlOds1v9aJs9Hx48uGamWkm/3cFmoJ5uA2ZzUwbSGjTkWbnhwzT0YRvcLGhP1WE/EswaIyK5qMp522E79mP1yH6M750iUvi4N39+QW1BNX3ADkOwyAI67ArX5on5gWP83RXcJ15im7XsBpsmVn/KXi6AouWPb8jmSmKCj0QZCzfLY7ivM42IugYpK2NV7kFB38DpXQamJ5eskgwYa3elRmednIFUuwb1QDnONvJogVjk4CLmoSxssC2mJnnrUItM7l8G6As81GMI+6lTtl86hAuXBjUk60FMbgTAQDX9ll26LgpBy8jHSx8=
# EB_AWS_SECRET_ACCESS_KEY # EB_AWS_SECRET_ACCESS_KEY
...@@ -58,6 +64,7 @@ env: ...@@ -58,6 +64,7 @@ env:
- NODE_ENV=production - NODE_ENV=production
- WWW_VERSION=${TRAVIS_COMMIT:0:5} - WWW_VERSION=${TRAVIS_COMMIT:0:5}
addons: addons:
chrome: stable
apt: apt:
sources: sources:
- ubuntu-toolchain-r-test - ubuntu-toolchain-r-test
...@@ -66,20 +73,33 @@ addons: ...@@ -66,20 +73,33 @@ addons:
install: install:
- sudo -H pip install -r requirements.txt - sudo -H pip install -r requirements.txt
- npm --production=false install - npm --production=false install
deploy: jobs:
- provider: script include:
skip_cleanup: $SKIP_CLEANUP - stage: test
script: env make sync deploy:
on: - provider: script
repo: LLK/scratch-www skip_cleanup: $SKIP_CLEANUP
branch: script: env make sync
- develop on:
- hotfix/* repo: LLK/scratch-www
- release/* branch:
- provider: script - develop
skip_cleanup: $SKIP_CLEANUP - hotfix/*
script: env make sync - release/*
on: - provider: script
repo: LLK/scratch-www skip_cleanup: $SKIP_CLEANUP
branch: script: env make sync
- master on:
repo: LLK/scratch-www
branch:
- master
- stage: smoke
install:
- cd test/integration
- npm install
- cd -
script: npm run smoke
stages:
- test
- name: smoke
if: branch IN (travis) and type != pull_request
{ {
"devDependencies": { "dependencies": {
"selenium-webdriver": "3.6.0", "selenium-webdriver": "3.6.0",
"chromedriver": "2.37.0" "chromedriver": "2.37.0"
} }
......
var webdriver = require('selenium-webdriver'); var webdriver = require('selenium-webdriver');
const driver = new webdriver.Builder() const headless = process.env.SMOKE_HEADLESS || false;
.forBrowser('chrome')
.build(); const getDriver = function () {
const chromeCapabilities = webdriver.Capabilities.chrome();
let args = [];
if (headless) {
args.push('--headless');
args.push('window-size=1024,1680');
args.push('--no-sandbox');
}
chromeCapabilities.set('chromeOptions', {args});
const newDriver = new webdriver.Builder()
.forBrowser('chrome')
.withCapabilities(chromeCapabilities)
.build();
return newDriver;
};
const driver = getDriver();
const {By, until} = webdriver; const {By, until} = webdriver;
...@@ -70,5 +86,6 @@ module.exports = { ...@@ -70,5 +86,6 @@ module.exports = {
clickButton, clickButton,
findByCss, findByCss,
clickCss, clickCss,
getLogs getLogs,
getDriver
}; };
...@@ -12,9 +12,9 @@ var seleniumWebdriver = require('selenium-webdriver'); ...@@ -12,9 +12,9 @@ var seleniumWebdriver = require('selenium-webdriver');
// Selenium's promise driver will be deprecated, so we should not rely on it // Selenium's promise driver will be deprecated, so we should not rely on it
seleniumWebdriver.SELENIUM_PROMISE_MANAGER = 0; seleniumWebdriver.SELENIUM_PROMISE_MANAGER = 0;
// chrome driver const {
var driver = new seleniumWebdriver.Builder().withCapabilities(seleniumWebdriver.Capabilities.chrome()) driver
.build(); } = require('../selenium-helpers.js');
var rootUrl = process.env.ROOT_URL || 'https://scratch.ly'; var rootUrl = process.env.ROOT_URL || 'https://scratch.ly';
......
Markdown is supported
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