Skip to content

Commit

Permalink
test if services are available
Browse files Browse the repository at this point in the history
Signed-off-by: Swikriti Tripathi <[email protected]>
  • Loading branch information
SwikritiT committed Sep 1, 2023
1 parent fb1c427 commit efe66c0
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 43 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,16 +105,16 @@ jobs:
sudo update-ca-certificates
ls ./apps/integration_openproject/ci/data/ssl
cd apps/integration_openproject/ci
docker compose up nextcloud proxy openproject -d
docker compose up nextcloud proxy openproject start_dependencies -d
- name: wait on OpenProject
uses: iFaxity/wait-on-action@v1
with:
resource: http-get://host.docker.internal:3000/api/v3/
timeout: 240000
# - name: wait on OpenProject
# uses: iFaxity/wait-on-action@v1
# with:
# resource: http-get://host.docker.internal:3000/api/v3/
# timeout: 240000

- name: wait on Nextcloud
run: until curl -s -f http://nextcloud/status.php | grep '"installed":true'; do echo .; sleep 10; done
run: until curl -s -f http://nextcloud.local/status.php | grep '"installed":true'; do echo .; sleep 10; done

- name: try Nextcloud 1
run: curl http://nextcloud.local/status.php -v
Expand Down
12 changes: 6 additions & 6 deletions ci/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,12 @@ services:
- ./data/ssl/:/usr/local/share/ca-certificates
# command: ["sh", "-c", "sudo update-ca-certificates && exec ./docker/prod/supervisord"]

# start_dependencies:
# image: dadarek/wait-for-dependencies
# depends_on:
# - proxy
# - openproject
# command: proxy:443 proxy:80 openproject:3000
start_dependencies:
image: dadarek/wait-for-dependencies
depends_on:
- proxy
- openproject
command: proxy:443 proxy:80 openproject:80

volumes:
data:
Expand Down
58 changes: 28 additions & 30 deletions tests/e2e/cucumber.config.js → cucumber.config.js
Original file line number Diff line number Diff line change
@@ -1,46 +1,44 @@
const { Before, BeforeAll, AfterAll, After, setDefaultTimeout } = require("@cucumber/cucumber")
const { chromium } = require("playwright")
const {config} = require("./config")
const { Before, BeforeAll, AfterAll, After, setDefaultTimeout } = require('@cucumber/cucumber')
const { chromium } = require('playwright')
const { config } = require('./config')
const apiHelper = require('./helpers/apiHelper')
const { OpenprojectAdminPage } = require("./pageObjects/OpenprojectAdminPage")
const opAdminPageObject = new OpenprojectAdminPage()
const { OpenprojectAdminPage } = require('./pageObjects/OpenprojectAdminPage')

setDefaultTimeout(120000)

BeforeAll(async function () {
await apiHelper.createAdmin()
BeforeAll(async function() {
// await apiHelper.createAdmin()
global.browserNC = await chromium.launch({
headless: true,
});
headless: false,
})
global.browserOP = await chromium.launch({
headless: true,
});
});
headless: false,
})
})

AfterAll(async function () {
AfterAll(async function() {
await global.browserNC.close()
await global.browserOP.close()
});
})

Before(async function () {
Before(async function() {
global.contextNC = await global.browserNC.newContext()
await contextNC.grantPermissions(['clipboard-read','clipboard-write']);
await contextNC.tracing.start({ screenshots: true, snapshots: true });
await contextNC.grantPermissions(['clipboard-read', 'clipboard-write'])
await contextNC.tracing.start({ screenshots: true, snapshots: true })
global.pageNC = await global.contextNC.newPage()
global.contextOP = await global.browserOP.newContext()
await contextOP.grantPermissions(['clipboard-read','clipboard-write']);
await contextOP.tracing.start({ screenshots: true, snapshots: true });
await contextOP.grantPermissions(['clipboard-read', 'clipboard-write'])
await contextOP.tracing.start({ screenshots: true, snapshots: true })
global.pageOP = await global.contextOP.newPage()
});
})

After(async function () {
After(async function() {
await apiHelper.resetNextcloudOauthSettings()
// await opAdminPageObject.deleteFileStorage()
await global.pageNC.close();
await contextNC.tracing.stop({ path: 'tests/e2e/report/traceNC.zip' });
await global.contextNC.close();
await global.pageOP.close();
await contextOP.tracing.stop({ path: 'tests/e2e/report/traceOP.zip' });
await global.contextOP.close();

});
await apiHelper.deleteStorage()
await global.pageNC.close()
await contextNC.tracing.stop({ path: 'tests/e2e/report/traceNC.zip' })
await global.contextNC.close()
await global.pageOP.close()
await contextOP.tracing.stop({ path: 'tests/e2e/report/traceOP.zip' })
await global.contextOP.close()
})

0 comments on commit efe66c0

Please sign in to comment.