Skip to content

Commit

Permalink
ci: Update BrowserStack browsers list we test on
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilogorek committed Feb 19, 2020
1 parent 973cfde commit 5d340fb
Show file tree
Hide file tree
Showing 6 changed files with 76 additions and 28 deletions.
2 changes: 1 addition & 1 deletion packages/browser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
"test:integration": "test/integration/run.js",
"test:integration:watch": "test/integration/run.js --watch",
"test:integration:checkbrowsers": "node scripts/checkbrowsers.js",
"test:manual": "node test/manual/npm-build.js && rm test/manual/tmp.js",
"test:package": "node test/package/npm-build.js && rm test/package/tmp.js",
"size:check": "run-p size:check:es5 size:check:es6",
"size:check:es5": "cat build/bundle.min.js | gzip -9 | wc -c | awk '{$1=$1/1024; print \"ES5: \",$1,\"kB\";}'",
"size:check:es6": "cat build/bundle.es6.min.js | gzip -9 | wc -c | awk '{$1=$1/1024; print \"ES6: \",$1,\"kB\";}'",
Expand Down
54 changes: 30 additions & 24 deletions packages/browser/test/integration/browsers.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,73 +4,81 @@
module.exports = {
bs_android_4: {
base: "BrowserStack",
browser: "Android Browser",
device: "Google Nexus 5",
browser: "Android",
device: "Samsung Galaxy Note 4",
os: "android",
os_version: "4.4",
real_mobile: true,
browser_version: null,
},
bs_android_5: {
base: "BrowserStack",
browser: "Android Browser",
device: "Google Nexus 9",
browser: "Android",
device: "Samsung Galaxy S6",
os: "android",
os_version: "5.1",
os_version: "5.0",
real_mobile: true,
browser_version: null,
},
bs_android_6: {
base: "BrowserStack",
browser: "Android Browser",
device: "Samsung Galaxy S7",
browser: "Android",
device: "Samsung Galaxy Note 4",
os: "android",
os_version: "6.0",
real_mobile: true,
browser_version: null,
},
bs_android_7: {
base: "BrowserStack",
browser: "Android Browser",
device: "Samsung Galaxy S8",
browser: "Android",
device: "Samsung Galaxy Note 8",
os: "android",
os_version: "7.0",
os_version: "7.1",
real_mobile: true,
browser_version: null,
},
bs_android_8: {
base: "BrowserStack",
browser: "Android Browser",
device: "Samsung Galaxy S9",
browser: "Android",
device: "Samsung Galaxy Note 9",
os: "android",
os_version: "8.0",
os_version: "8.1",
real_mobile: true,
browser_version: null,
},
bs_android_9: {
base: "BrowserStack",
browser: "Android Browser",
device: "Samsung Galaxy S9 Plus",
browser: "Android",
device: "Samsung Galaxy Note 10 Plus",
os: "android",
os_version: "9.0",
real_mobile: true,
browser_version: null,
},
bs_ios_11: {
bs_android_10: {
base: "BrowserStack",
browser: "Android",
device: "Google Pixel 4 XL",
os: "android",
os_version: "10.0",
real_mobile: true,
},
bs_ios_12: {
base: "BrowserStack",
browser: "Mobile Safari",
device: "iPhone 6",
device: "iPhone XS",
os: "ios",
os_version: "11.4",
os_version: "12",
real_mobile: true,
browser_version: null,
},
bs_ios_12: {
bs_ios_13: {
base: "BrowserStack",
browser: "Mobile Safari",
device: "iPhone 8",
device: "iPhone 11",
os: "ios",
os_version: "12.1",
os_version: "13",
real_mobile: true,
browser_version: null,
},
Expand All @@ -97,9 +105,7 @@ module.exports = {
browser: "Safari",
browser_version: "latest",
os: "OS X",
os_version: "Mojave",
device: null,
real_mobile: null,
os_version: "Catalina",
},
bs_edge: {
base: "BrowserStack",
Expand Down
11 changes: 10 additions & 1 deletion packages/browser/test/integration/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@ const isLocalRun =
const customLaunchers = isLocalRun ? {} : require("./browsers.js");
const browsers = isLocalRun ? ["ChromeHeadless"] : Object.keys(customLaunchers);

// NOTE: It "should" work as a global `build` config option, but it doesn't, so setting it up
// for each browser here, so that we have a nice distinction of when the tests were run exactly.
if (!isLocalRun) {
for (const browser in customLaunchers) {
customLaunchers[browser].build = process.env.TRAVIS_BUILD_NUMBER
? `Travis: ${process.env.TRAVIS_BUILD_NUMBER}`
: `Manual: ${new Date().toLocaleString()}`;
}
}

const plugins = [
"karma-mocha",
"karma-chai",
Expand Down Expand Up @@ -76,7 +86,6 @@ module.exports = config => {
ui: "bdd",
},
},
build: process.env.TRAVIS_BUILD_NUMBER || Date.now(),
concurrency: isLocalRun ? 1 : 2,
retryLimit: 5,
browserDisconnectTolerance: 5,
Expand Down
33 changes: 33 additions & 0 deletions packages/browser/test/integration/suites/breadcrumbs.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,39 @@ describe("breadcrumbs", function() {
}
);

it(
optional(
"should record an XMLHttpRequest with a handler attached after send was called",
IS_LOADER
),
function() {
return runInSandbox(sandbox, { manual: true }, function() {
var xhr = new XMLHttpRequest();
xhr.open("GET", "/base/subjects/example.json");
xhr.send();
xhr.onreadystatechange = function() {
window.handlerCalled = true;
};
waitForXHR(xhr, function() {
Sentry.captureMessage("test");
window.finalizeManualTest();
});
}).then(function(summary) {
// The async loader doesn't wrap XHR
if (IS_LOADER) {
return;
}
assert.equal(summary.breadcrumbs.length, 1);
assert.equal(summary.breadcrumbs[0].type, "http");
assert.equal(summary.breadcrumbs[0].category, "xhr");
assert.equal(summary.breadcrumbs[0].data.method, "GET");
assert.typeOf(summary.breadcrumbs[0].timestamp, "number");
assert.isTrue(summary.window.handlerCalled);
delete summary.window.handlerCalled;
});
}
);

it(
optional(
"should record an XMLHttpRequest without any handlers set",
Expand Down
2 changes: 1 addition & 1 deletion packages/utils/src/instrument.ts
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ function instrumentXHR(): void {
...commonHandlerData,
});

xhr.addEventListener('readystatechange', function() {
xhr.addEventListener('readystatechange', function(): void {
if (xhr.readyState === 4) {
try {
// touching statusCode in some platforms throws
Expand Down
2 changes: 1 addition & 1 deletion scripts/browser-integration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ yarn
yarn build
cd packages/browser
yarn test:integration
yarn test:manual
yarn test:package

0 comments on commit 5d340fb

Please sign in to comment.