Skip to content

Commit ad3d8e8

Browse files
committed
build: attempt to de-flake harness integration test
Tries to de-flake the harness e2e integration test by swapping out `mat-select` with `mat-radio-group`. `mat-select` has been causing flakes in its own Firefox tests too so it's possible that it may be the reason for the integration test flakes as well. The component being tested doesn't really matter since the integration test is primarily verifying our npm packages.
1 parent b5c935a commit ad3d8e8

File tree

4 files changed

+15
-24
lines changed

4 files changed

+15
-24
lines changed

.circleci/config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ var_2: &docker-browser-image cimg/node:16.14.0-browsers
1313
# **Note**: When updating the beginning of the cache key, also update the cache key to match
1414
# the new cache key prefix. This allows us to take advantage of CircleCI's fallback caching.
1515
# Read more here: https://circleci.com/docs/2.0/caching/#restoring-cache.
16-
var_3: &cache_key v10-ng-mat-{{ checksum ".bazelversion" }}-{{ checksum "tools/postinstall/apply-patches.js" }}-{{ checksum "WORKSPACE" }}-{{ checksum "yarn.lock" }}
16+
var_3: &cache_key v11-ng-mat-{{ checksum ".bazelversion" }}-{{ checksum "tools/postinstall/apply-patches.js" }}-{{ checksum "WORKSPACE" }}-{{ checksum "yarn.lock" }}
1717
# We want to invalidate the cache if the postinstall patches change. In order to apply new
1818
# patches, a clean version of the node modules is needed. Additionally, we invalidate the cache
1919
# if the Bazel version changes. We do this because otherwise the `bazelisk` cache folder will
2020
# contain all previously used versions and ultimately cause the cache restoring to be slower.
21-
var_4: &cache_fallback_key v10-ng-mat-{{ checksum ".bazelversion" }}-{{ checksum "tools/postinstall/apply-patches.js" }}-
21+
var_4: &cache_fallback_key v11-ng-mat-{{ checksum ".bazelversion" }}-{{ checksum "tools/postinstall/apply-patches.js" }}-
2222

2323
# Settings common to each job
2424
var_5: &job_defaults
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {MatSelectHarness} from '@angular/material/select/testing';
1+
import {MatRadioGroupHarness} from '@angular/material/radio/testing';
22
import {SeleniumWebDriverHarnessEnvironment} from '@angular/cdk/testing/selenium-webdriver';
33
import {HarnessLoader} from '@angular/cdk/testing';
44
import {configureDriver} from './driver.js';
@@ -15,18 +15,14 @@ describe('app test', () => {
1515
});
1616

1717
it('should work', async () => {
18-
const select = await loader.getHarness(MatSelectHarness);
18+
const group = await loader.getHarness(MatRadioGroupHarness);
1919

20-
expect(select).toBeDefined();
21-
expect(await select.getValueText()).toBe('');
20+
expect(group).toBeDefined();
21+
expect(await group.getCheckedValue()).toBe(null);
2222

23-
await select.open();
23+
const buttons = await group.getRadioButtons();
24+
await buttons[1].check();
2425

25-
const options = await select.getOptions();
26-
27-
await options[0].click();
28-
await select.close();
29-
30-
expect(await select.getValueText()).toBe('First');
26+
expect(await group.getCheckedValue()).toBe('Second');
3127
});
3228
});
Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
<mat-form-field>
2-
<mat-label>Select</mat-label>
3-
<mat-select>
4-
<mat-option value="first">First</mat-option>
5-
<mat-option value="second">Second</mat-option>
6-
</mat-select>
7-
</mat-form-field>
1+
<mat-radio-group name="radio-group">
2+
<mat-radio-button value="first">First</mat-radio-button>
3+
<mat-radio-button value="second">Second</mat-radio-button>
4+
</mat-radio-group>

integration/harness-e2e-cli/src/app/app.module.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,11 @@ import {BrowserModule} from '@angular/platform-browser';
33
import {NoopAnimationsModule} from '@angular/platform-browser/animations';
44

55
import {AppComponent} from './app.component';
6-
import {MatSelectModule} from '@angular/material/select';
7-
import {MatFormFieldModule} from '@angular/material/form-field';
6+
import {MatRadioModule} from '@angular/material/radio';
87

98
@NgModule({
109
declarations: [AppComponent],
11-
imports: [MatSelectModule, MatFormFieldModule, NoopAnimationsModule, BrowserModule],
12-
providers: [],
10+
imports: [MatRadioModule, NoopAnimationsModule, BrowserModule],
1311
bootstrap: [AppComponent],
1412
})
1513
export class AppModule {}

0 commit comments

Comments
 (0)