diff --git a/.github/workflows/deployapp.yml b/.github/workflows/deployapp.yml index 1d9456a..b778816 100644 --- a/.github/workflows/deployapp.yml +++ b/.github/workflows/deployapp.yml @@ -116,9 +116,20 @@ 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 @@ -126,8 +137,12 @@ jobs: - 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 diff --git a/brewdis-ui/__tests__/e2e/index.spec.js b/brewdis-ui/__tests__/e2e/index.spec.js index 239a63e..b3325b2 100644 --- a/brewdis-ui/__tests__/e2e/index.spec.js +++ b/brewdis-ui/__tests__/e2e/index.spec.js @@ -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; @@ -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 () => { diff --git a/brewdis-ui/jest-playwright.config.js b/brewdis-ui/jest-playwright.config.js index 67b994b..98994f5 100644 --- a/brewdis-ui/jest-playwright.config.js +++ b/brewdis-ui/jest-playwright.config.js @@ -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 + // } } \ No newline at end of file