Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions .github/workflows/deployapp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,18 +116,33 @@ jobs:
STOMP_PORT=$STOMP_PORT \
CONFIG_STORE_ENDPOINT=$CONFIG_STORE_ENDPOINT

# - name: Save deployment url to a file
# run: echo -n "https://$SPRING_CLOUD_SERVICE-$SPRING_CLOUD_APP.azuremicroservices.io" > deployment_url

# - name: Upload deployment url as artifact
# uses: actions/upload-artifact@v2
# with:
# name: deployment_url
# path: deployment_url

e2e-tests:
runs-on: ubuntu-latest
needs: [terraform, configure_app]
env:
APP_URL: "https://brewredis-prod-storefront.azuremicroservices.io"

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- uses: microsoft/playwright-github-action@v1
- name: Install dependencies
run: cd brewdis-ui && npm install
- name: Build Angular app
run: cd brewdis-ui && npm run build
# - name: Download deployment url artifact
# uses: actions/download-artifact@v1
# with:
# name: deployment_url
# - name: Read deployment url from file and set as env var
# run: export APP_URL=`cat deployment_url`
- name: Run Playwright tests
run: cd brewdis-ui && npm run e2e
- uses: actions/upload-artifact@v2
Expand Down
6 changes: 5 additions & 1 deletion brewdis-ui/__tests__/e2e/index.spec.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
const { categories, products, availability } = require('./responses');

const appUrl = (() => {
return process.env.APP_URL || 'http://localhost:4200';
})();

describe('brewdis tests', () => {
jest.setTimeout(40 * 1000);
let page;
Expand All @@ -14,7 +18,7 @@ describe('brewdis tests', () => {

beforeEach(async() => {
page = await context.newPage();
await page.goto('http://localhost:4200/');
await page.goto(appUrl);
});

it('should have correct title', async () => {
Expand Down
10 changes: 5 additions & 5 deletions brewdis-ui/jest-playwright.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ module.exports = {
headless: true
},
browsers: ['chromium', 'firefox', 'webkit'],
server: {
command: 'npm run start',
launchTimeout: 30000,
port: 4200
}
// server: {
// command: 'npm run start',
// launchTimeout: 30000,
// port: 4200
// }
}