fixed set-env.ts, reverted unnecessary e2e changes, updated travis.yml

This commit is contained in:
lotte
2020-04-29 16:28:26 +02:00
parent 7ec7d3a455
commit ef91468310
6 changed files with 45 additions and 51 deletions

View File

@@ -1,10 +1,25 @@
sudo: required sudo: required
dist: bionic dist: bionic
language: node_js
# Enable caching for yarn & node_modules
cache:
yarn: true
node_js:
- "10"
- "12"
# Install latest chrome (for e2e headless testing). Run an update if needed.
addons:
apt:
sources:
- google-chrome
packages:
- google-chrome-stable
update: true
env: env:
# Install the latest docker-compose version for ci testing.
# The default installation in travis is not compatible with the latest docker-compose file version.
COMPOSE_VERSION: 1.24.1
# The ci step will test the dspace-angular code against DSpace REST. # The ci step will test the dspace-angular code against DSpace REST.
# Direct that step to utilize a DSpace REST service that has been started in docker. # Direct that step to utilize a DSpace REST service that has been started in docker.
DSPACE_REST_HOST: localhost DSPACE_REST_HOST: localhost
@@ -12,46 +27,31 @@ env:
DSPACE_REST_NAMESPACE: '/server/api' DSPACE_REST_NAMESPACE: '/server/api'
DSPACE_REST_SSL: false DSPACE_REST_SSL: false
services:
- xvfb
before_install: before_install:
# Docker Compose Install # Check our versions of everything
- curl -L https://github.com/docker/compose/releases/download/${COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > docker-compose - echo "Check versions"
- chmod +x docker-compose - yarn -v
- sudo mv docker-compose /usr/local/bin - docker-compose -v
- google-chrome-stable --version
install: install:
# update chrome
- wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
- sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'
- sudo apt-get update
- sudo apt-get install google-chrome-stable
# Start up DSpace 7 using the entities database dump # Start up DSpace 7 using the entities database dump
- docker-compose -f ./docker/docker-compose-travis.yml up -d - docker-compose -f ./docker/docker-compose-travis.yml up -d
# Use the dspace-cli image to populate the assetstore. Trigger a discovery and oai update # Use the dspace-cli image to populate the assetstore. Triggers a discovery and oai update
- docker-compose -f ./docker/cli.yml -f ./docker/cli.assetstore.yml run --rm dspace-cli - docker-compose -f ./docker/cli.yml -f ./docker/cli.assetstore.yml run --rm dspace-cli
- travis_retry yarn install - travis_retry yarn install
before_script: before_script:
- echo "Check Docker containers"
- docker container ls
# The following line could be enabled to verify that the rest server is responding. # The following line could be enabled to verify that the rest server is responding.
# Currently, "yarn run build" takes enough time to run to allow the service to be available #- echo "Check REST API available (via Docker)"
#- curl http://localhost:8080/ #- curl http://localhost:8080/server/
after_script:
- docker-compose -f ./docker/docker-compose-travis.yml down
language: node_js
node_js:
- "10"
- "12"
cache:
yarn: true
bundler_args: --retry 5
script: script:
- yarn run ci - yarn run ci
- cat coverage/dspace-angular-cli/lcov.info | ./node_modules/coveralls/bin/coveralls.js - cat coverage/dspace-angular-cli/lcov.info | ./node_modules/coveralls/bin/coveralls.js
after_script:
# Shutdown docker after everything runs
- docker-compose -f ./docker/docker-compose-travis.yml down

View File

@@ -33,7 +33,7 @@ exports.config = {
'version': '', 'version': '',
'platform': 'ANY', 'platform': 'ANY',
'chromeOptions': { 'chromeOptions': {
args: ['--headless', '--no-sandbox', '--disable-gpu'] 'args': [ '--headless', '--disable-gpu' ]
} }
}, },
// ----------------------------------------------------------------- // -----------------------------------------------------------------

View File

@@ -1,5 +1,4 @@
import { ProtractorPage } from './app.po'; import { ProtractorPage } from './app.po';
import { browser, by, element, protractor } from 'protractor';
describe('protractor App', () => { describe('protractor App', () => {
let page: ProtractorPage; let page: ProtractorPage;
@@ -9,19 +8,15 @@ describe('protractor App', () => {
}); });
it('should display translated title "DSpace Angular :: Home"', () => { it('should display translated title "DSpace Angular :: Home"', () => {
page.navigateTo() page.navigateTo();
.then(() => page.waitUntilNotLoading()) page.waitUntilNotLoading();
.then(() => {
expect<any>(page.getPageTitleText()).toEqual('DSpace Angular :: Home'); expect<any>(page.getPageTitleText()).toEqual('DSpace Angular :: Home');
}
)
;
}); });
it('should contain a news section', () => { it('should contain a news section', () => {
page.navigateTo() page.navigateTo();
.then(() => page.waitUntilNotLoading()) page.waitUntilNotLoading();
.then(() => page.getHomePageNewsText()) const text = page.getHomePageNewsText();
.then((text) => expect<any>(text).toBeDefined()); expect<any>(text).toBeDefined();
}); });
}); });

View File

@@ -18,6 +18,6 @@ export class ProtractorPage {
const loading = element(by.css('.loader')) const loading = element(by.css('.loader'))
const EC = protractor.ExpectedConditions; const EC = protractor.ExpectedConditions;
const notLoading = EC.not(EC.presenceOf(loading)); const notLoading = EC.not(EC.presenceOf(loading));
return browser.wait(notLoading, 180000); return browser.wait(notLoading, 10000);
} }
} }

View File

@@ -1,6 +1,5 @@
import { ProtractorPage } from './search-page.po'; import { ProtractorPage } from './search-page.po';
import { browser } from 'protractor'; import { browser } from 'protractor';
import { promise } from 'selenium-webdriver';
describe('protractor SearchPage', () => { describe('protractor SearchPage', () => {
let page: ProtractorPage; let page: ProtractorPage;
@@ -22,9 +21,9 @@ describe('protractor SearchPage', () => {
page.navigateToSearch() page.navigateToSearch()
.then(() => page.getRandomScopeOption()) .then(() => page.getRandomScopeOption())
.then((scopeString: string) => { .then((scopeString: string) => {
page.navigateToSearchWithScopeParameter(scopeString) page.navigateToSearchWithScopeParameter(scopeString);
.then(() => page.waitUntilNotLoading()) page.waitUntilNotLoading();
.then(() => page.getCurrentScope()) page.getCurrentScope()
.then((s: string) => { .then((s: string) => {
expect<string>(s).toEqual(scopeString); expect<string>(s).toEqual(scopeString);
}) })

View File

@@ -72,7 +72,7 @@ function createServerConfig(host?: string, port?: string, nameSpace?: string, s
} }
if (hasValue(nameSpace)) { if (hasValue(nameSpace)) {
result.host = nameSpace; result.nameSpace = nameSpace;
} }
if (hasValue(port)) { if (hasValue(port)) {