Skip to content

Commit

Permalink
[test] Move Firefox tests to CircleCI (#34764)
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari committed Oct 29, 2022
1 parent e0141b8 commit bb84c5a
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 21 deletions.
1 change: 1 addition & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,7 @@ jobs:
exit 0
test_browser:
<<: *defaults
resource_class: 'medium+'
docker:
- image: mcr.microsoft.com/playwright:v1.27.1-focal
environment:
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@
"karma": "^6.4.1",
"karma-browserstack-launcher": "~1.6.0",
"karma-chrome-launcher": "^3.1.1",
"karma-firefox-launcher": "^2.1.2",
"karma-coverage-istanbul-reporter": "^3.0.3",
"karma-mocha": "^2.0.1",
"karma-sourcemap-loader": "^0.3.8",
Expand Down
19 changes: 7 additions & 12 deletions packages/mui-material/src/IconButton/IconButton.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,13 @@ describe('<IconButton />', () => {
expect(container.querySelector('.touch-ripple')).not.to.equal(null);
});

['default', 'primary'].forEach((color) => {
it(`can disable the ripple and hover effect for color ${color}`, () => {
const { container, getByRole } = render(
<IconButton disableRipple color={color} TouchRippleProps={{ className: 'touch-ripple' }}>
book
</IconButton>,
);
expect(container.querySelector('.touch-ripple')).to.equal(null);
expect(getComputedStyle(getByRole('button'), ':hover').backgroundColor).to.equal(
getComputedStyle(getByRole('button')).backgroundColor,
);
});
it('can disable the ripple and hover effect', () => {
const { container } = render(
<IconButton disableRipple TouchRippleProps={{ className: 'touch-ripple' }}>
book
</IconButton>,
);
expect(container.querySelector('.touch-ripple')).to.equal(null);
});

describe('prop: size', () => {
Expand Down
13 changes: 4 additions & 9 deletions test/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ const browserStack = {
};

process.env.CHROME_BIN = playwright.chromium.executablePath();
process.env.FIREFOX_BIN = playwright.firefox.executablePath();

// BrowserStack rate limit after 1600 calls every 5 minutes.
// Per second, https://www.browserstack.com/docs/automate/api-reference/selenium/introduction#rest-api-projects
Expand All @@ -45,7 +46,7 @@ const MAX_CIRCLE_CI_CONCURRENCY = 83;
module.exports = function setKarmaConfig(config) {
const baseConfig = {
basePath: '../',
browsers: ['chromeHeadless'],
browsers: ['chromeHeadless', 'FirefoxHeadless'],
browserDisconnectTimeout: 3 * 60 * 1000, // default 2000
browserDisconnectTolerance: 1, // default 0
browserNoActivityTimeout: 3 * 60 * 1000, // default 30000
Expand Down Expand Up @@ -83,6 +84,7 @@ module.exports = function setKarmaConfig(config) {
'karma-coverage-istanbul-reporter',
'karma-sourcemap-loader',
'karma-webpack',
'karma-firefox-launcher',
],
/**
* possible values:
Expand Down Expand Up @@ -212,7 +214,7 @@ module.exports = function setKarmaConfig(config) {
newConfig = {
...baseConfig,
browserStack,
browsers: baseConfig.browsers.concat(['chrome', 'firefox', 'safari', 'edge']),
browsers: baseConfig.browsers.concat(['chrome', 'safari', 'edge']),
plugins: baseConfig.plugins.concat(['karma-browserstack-launcher']),
customLaunchers: {
...baseConfig.customLaunchers,
Expand All @@ -226,13 +228,6 @@ module.exports = function setKarmaConfig(config) {
// TODO: Investigate why.
browser_version: '87.0',
},
firefox: {
base: 'BrowserStack',
os: 'Windows',
os_version: '10',
browser: 'firefox',
browser_version: '78.0',
},
safari: {
base: 'BrowserStack',
os: 'OS X',
Expand Down
8 changes: 8 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10290,6 +10290,14 @@ karma-coverage-istanbul-reporter@^3.0.3:
istanbul-reports "^3.0.2"
minimatch "^3.0.4"

karma-firefox-launcher@^2.1.2:
version "2.1.2"
resolved "https://registry.yarnpkg.com/karma-firefox-launcher/-/karma-firefox-launcher-2.1.2.tgz#9a38cc783c579a50f3ed2a82b7386186385cfc2d"
integrity sha512-VV9xDQU1QIboTrjtGVD4NCfzIH7n01ZXqy/qpBhnOeGVOkG5JYPEm8kuSd7psHE6WouZaQ9Ool92g8LFweSNMA==
dependencies:
is-wsl "^2.2.0"
which "^2.0.1"

karma-mocha@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/karma-mocha/-/karma-mocha-2.0.1.tgz#4b0254a18dfee71bdbe6188d9a6861bf86b0cd7d"
Expand Down

0 comments on commit bb84c5a

Please sign in to comment.