Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✅[e2e cbt] make scenarios compatible with safari #195

Merged
merged 2 commits into from
Dec 5, 2019
Merged
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
2 changes: 1 addition & 1 deletion packages/core/src/requestCollection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export function trackFetch(observable: RequestObservable) {
const reportFetchError = async (response: Response | Error) => {
const duration = performance.now() - startTime
const url = normalizeUrl((typeof input === 'object' && input.url) || (input as string))
if ('stack' in response) {
if ('stack' in response || response instanceof Error) {
const stackTrace = computeStackTrace(response)
observable.notify({
duration,
Expand Down
11 changes: 1 addition & 10 deletions test/e2e/scenario/agents.scenario.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,6 @@ describe('rum', () => {
})

it('should track xhr timings', async () => {
if (browser.capabilities.browserName === 'Safari') {
pending('XHR timings is not fully supported in Safari yet')
}

await browserExecuteAsync((baseUrl, done) => {
let loaded = false
const xhr = new XMLHttpRequest()
Expand All @@ -104,7 +100,6 @@ describe('rum', () => {
expect((timing.http as any).status_code).toEqual(200)
expect(timing.duration).toBeGreaterThan(0)
expect(timing.http.performance!.download.start).toBeGreaterThan(0)
expect(timing.http.performance!.download.duration).toBeGreaterThan(0)
})

it('should send performance timings along the view events', async () => {
Expand Down Expand Up @@ -189,10 +184,6 @@ describe('error collection', () => {
})

it('should track fetch error', async () => {
if (browser.capabilities.browserName === 'Safari') {
pending('fetch patching is not fully supported in Safari yet')
}

await browserExecuteAsync(
(baseUrl, unreachableUrl, done) => {
let count = 0
Expand Down Expand Up @@ -223,6 +214,6 @@ describe('error collection', () => {

expect(logs[1].message).toEqual(`Fetch error GET ${UNREACHABLE_URL}`)
expect(logs[1].http.status_code).toEqual(0)
expect(logs[1].error.stack).toEqual('TypeError: Failed to fetch')
expect(logs[1].error.stack).toContain('TypeError')
})
})