Skip to content

Commit

Permalink
✅ [e2e] add async setup
Browse files Browse the repository at this point in the history
  • Loading branch information
bcaudan committed Feb 13, 2020
1 parent 479b558 commit 5bb37fb
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,18 @@ npm-e2e:
- yarn
- yarn test:e2e:npm

async-e2e:
stage: test
tags: ['runner:main', 'size:large']
image: $CI_IMAGE
artifacts:
paths:
- test/server/test-server.log
when: always
script:
- yarn
- yarn test:e2e:async

check-licenses:
stage: test
tags: ['runner:main', 'size:large']
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"test:e2e": "yarn run test:e2e:bundle",
"test:e2e:bundle": "TARGET_ENV=e2e-test yarn build && E2E_MODE=bundle wdio test/e2e/wdio.local.conf.js",
"test:e2e:npm": "TARGET_ENV=e2e-test yarn build && (cd test/app && rm -rf node_modules && yarn && yarn build) && E2E_MODE=npm wdio test/e2e/wdio.local.conf.js",
"test:e2e:async": "TARGET_ENV=e2e-test yarn build && E2E_MODE=async wdio test/e2e/wdio.local.conf.js",
"test:e2e:cbt": "TARGET_ENV=e2e-test yarn build && node ./scripts/cbt-with-retry.js wdio test/e2e/wdio.cbt.conf.js",
"test:tsc:3.0": "yarn build && (cd test/app && rm -rf node_modules && yarn && yarn tsc:compatibility)"
},
Expand Down
42 changes: 42 additions & 0 deletions test/static/async-e2e-page.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/x-icon" href="/favicon.ico" />
<title>async tests page</title>
</head>
<body>
<button>click me</button>
<script type="text/javascript">
window.addEventListener('load', () => {
const logs = document.createElement('script')
logs.src = './datadog-logs-us.js'
logs.onload = () => {
window.DD_LOGS &&
window.DD_LOGS.init({
clientToken: 'key',
internalMonitoringEndpoint: `${window.location.origin}/monitoring`,
logsEndpoint: `${window.location.origin}/logs`,
rumEndpoint: `${window.location.origin}/rum`,
forwardErrorsToLogs: true,
})
}
document.getElementsByTagName('head')[0].appendChild(logs)

const rum = document.createElement('script')
rum.src = './datadog-rum-us.js'
rum.onload = () => {
window.DD_RUM &&
window.DD_RUM.init({
applicationId: 'rum',
clientToken: 'key',
internalMonitoringEndpoint: `${window.location.origin}/monitoring`,
logsEndpoint: `${window.location.origin}/logs`,
rumEndpoint: `${window.location.origin}/rum`,
})
}
document.getElementsByTagName('head')[0].appendChild(rum)
})
</script>
</body>
</html>

0 comments on commit 5bb37fb

Please sign in to comment.