Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:superdesk/superdesk-client-core …
Browse files Browse the repository at this point in the history
…into develop
  • Loading branch information
fritzSF committed Nov 2, 2023
2 parents 4530e8e + 8dd0036 commit ace27a0
Show file tree
Hide file tree
Showing 50 changed files with 1,947 additions and 663 deletions.
3 changes: 3 additions & 0 deletions .fireq.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"superdesk_branch": "release/2.5"
}
5 changes: 5 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,8 @@ jobs:
with:
name: screenshots-e2e-${{ matrix.suite }}
path: /tmp/*.png

- name: Server Logs
if: ${{ failure() }}
run: docker-compose logs superdesk
working-directory: e2e/server
2 changes: 1 addition & 1 deletion e2e/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"jasmine-reporters": "2.3.0",
"protractor": "7.0.0",
"typescript": "4.9.3",
"webdriver-manager": "^12.1.8"
"webdriver-manager": "^12.1.9"
},
"scripts": {
"build": "npx @superdesk/build-tools build-root-repo ./",
Expand Down
12 changes: 12 additions & 0 deletions e2e/client/protractor.conf.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* eslint-disable comma-dangle */

var path = require('path');
const execSync = require('child_process').execSync;

function getChromeOptions() {
var chromeOptions = {
Expand Down Expand Up @@ -55,6 +56,16 @@ var config = {
chromeDriver: process.env.CHROMEWEBDRIVER ? (process.env.CHROMEWEBDRIVER + '/chromedriver') : null,

onPrepare: function() {
execSync(
`
echo "chrome version:" && $CHROME_BIN --version
echo "\n"
echo "webdriver-manager version:" && npx webdriver-manager version
echo "\n"
`,
{stdio: 'inherit'},
);

require('./specs/helpers/setup').setup({fixture_profile: 'app_prepopulate_data'});

// so it can be used without import in tests
Expand All @@ -73,6 +84,7 @@ var config = {
this.specDone = function(result) {
if (result.failedExpectations.length > 0) {
browser.screenshot(result.fullName.replace(/[^\w]+/g, '-'));
require('./specs/helpers/utils').printLogs();
}
};
}
Expand Down
20 changes: 3 additions & 17 deletions e2e/client/run-end-to-end-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,10 @@ function installWebdriverDriver() {
} catch (_) {
// driver not installed, installing:

let version = null;

try {
version = execSync('chromium-browser --product-version').toString();
} catch (_) {
// Chromium not installed
}

if (version == null) {
try {
version = execSync('google-chrome --product-version --product-version').toString();
} catch (_) {
// Google Chrome not installed
}
}
const version = execSync('$CHROME_BIN --product-version').toString();

if (version == null) {
return reject('To launch the test server either Chromium or Google Chrome has to be installed.');
return reject('To launch the test server a chrome based browser has to be installed and CHROME_BIN environment variable set.');
}

console.info('Installing webdriver...', version);
Expand All @@ -52,7 +38,7 @@ ensurePackageInstalled()
.then(() => {
const argumentsToForward = process.argv.slice(2).join(' ');

return execSync(`npx protractor protractor.conf.js ${argumentsToForward}`, {stdio: 'inherit'});
execSync(`npx protractor protractor.conf.js ${argumentsToForward}`, {stdio: 'inherit'});
})
.catch((e) => {
console.error(e);
Expand Down
7 changes: 3 additions & 4 deletions e2e/client/specs/helpers/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,9 @@ export function printLogs(prefix) {
.then((browserLog) => {
var logs = browserLog.filter((log) => log.level.value >= 1000);

console.info(
(prefix ? prefix + ' ' : '') +
'log: ' + require('util').inspect(logs, {dept: 3}),
);
for (const log of logs) {
console.error(`BROWSER CONSOLE ERROR: ${log.message}`);
}
});
}

Expand Down
2 changes: 1 addition & 1 deletion e2e/server/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.8
FROM python:3.10

ADD requirements.txt .
RUN pip3 install -U pip wheel setuptools
Expand Down
1 change: 1 addition & 0 deletions e2e/server/Procfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
rest: PYTHONUNBUFFERED=True gunicorn -c gunicorn_config.py wsgi
wamp: python3 -u ws.py
work: celery -A worker worker
1 change: 1 addition & 0 deletions e2e/server/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ services:
- e2e
environment:
- discovery.type=single-node
- action.auto_create_index=false
tmpfs:
- /usr/share/elasticsearch/data

Expand Down
2 changes: 1 addition & 1 deletion e2e/server/requirements.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
honcho
gunicorn
git+https://github.com/superdesk/superdesk-core.git@v2.6.0#egg=Superdesk-Core
git+https://github.com/superdesk/superdesk-core.git@develop#egg=Superdesk-Core
Loading

0 comments on commit ace27a0

Please sign in to comment.