Skip to content

Angular version update #1126

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

Open
wants to merge 40 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
679d52b
angular 15 udpate
vchaitanya Apr 3, 2025
a9093c1
material 15 update
vchaitanya Apr 3, 2025
e86916a
node 16 update
vchaitanya Apr 3, 2025
3c2c9ff
Typescript 4.9.5 update
vchaitanya Apr 3, 2025
840ed4f
MDC migration
vchaitanya Apr 3, 2025
8741f65
Mdc fix
vchaitanya Apr 4, 2025
e2e94ed
MDC fix
vchaitanya Apr 4, 2025
0f22d35
Revert few mdc changes
vchaitanya Apr 4, 2025
30f7635
Change tab class name for mdc
vchaitanya Apr 4, 2025
5630414
Zone.js downgrade to 0.13.0, ngx-markdown update to V15
vchaitanya Apr 4, 2025
c7cc09b
MDC fix for AbstractSequence
vchaitanya Apr 4, 2025
250dc54
Mdc fix, css changes
vchaitanya Apr 5, 2025
3fba6de
MDC fixes
vchaitanya Apr 5, 2025
8d8dac5
Filter drag and drop changes
vchaitanya Apr 5, 2025
4d3787e
Angular 16 update
vchaitanya Apr 5, 2025
5426d86
material 16 update
vchaitanya Apr 5, 2025
80c37a0
Version updates
vchaitanya Apr 5, 2025
75bcdb7
angular 17 update
vchaitanya Apr 5, 2025
5cc2aa0
material 17 update
vchaitanya Apr 5, 2025
50f5aea
angular 18 update
vchaitanya Apr 5, 2025
e5f4bbd
material 18 update
vchaitanya Apr 5, 2025
5e25e06
Revert "material 18 update"
vchaitanya Apr 5, 2025
5aeb656
Revert "angular 18 update"
vchaitanya Apr 5, 2025
24557e0
Revert "material 17 update"
vchaitanya Apr 5, 2025
0db4a01
Revert "angular 17 update"
vchaitanya Apr 5, 2025
ca72efa
Revert "Version updates"
vchaitanya Apr 5, 2025
d7c9424
node v18 update
vchaitanya Apr 5, 2025
0572f64
Version updates
vchaitanya Apr 6, 2025
89dcb16
angular 17 update
vchaitanya Apr 6, 2025
325db82
material 17 update
vchaitanya Apr 5, 2025
66f4ab8
angular 18 update
vchaitanya Apr 6, 2025
5e16efe
material 18 update
vchaitanya Apr 5, 2025
4643a9c
Test fix
vchaitanya Apr 6, 2025
3921f1f
Remove tick icon for mat-button-toggle
vchaitanya Apr 6, 2025
f38fd6c
fixup! Remove tick icon for mat-button-toggle
vchaitanya Apr 6, 2025
2061201
Migration to the inject function
vchaitanya Apr 6, 2025
0f26974
Icon injection pattern update
vchaitanya Apr 6, 2025
68ddf45
Remove webdrivermanager
vchaitanya Apr 7, 2025
a25aa6f
Merge branch 'main' of https://github.com/Mastercard/flow into angula…
vchaitanya Apr 7, 2025
99f01ed
Revert disabled test
vchaitanya Apr 9, 2025
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 .github/workflows/mutation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- name: Set up Node
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
with:
node-version: '14.15.1'
node-version: '18.19.1'
cache: 'npm'
cache-dependency-path: report/report-ng/package-lock.json

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Set up Node
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
with:
node-version: '14.15.1'
node-version: '18.19.1'
cache: 'npm'
cache-dependency-path: report/report-ng/package-lock.json

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sonar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- name: Set up Node
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
with:
node-version: '14.15.1'
node-version: '18.19.1'
cache: 'npm'
cache-dependency-path: report/report-ng/package-lock.json

Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/static_artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,24 @@ jobs:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Set up JDK 17
uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12 # v4.7.0
uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12 # v4.7.0
with:
java-version: '17'
distribution: 'temurin'
cache: maven

- name: Set up Node
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
with:
node-version: '14.15.1'
node-version: '18.19.1'
cache: 'npm'
cache-dependency-path: report/report-ng/package-lock.json

- name: Build with Maven
run: mvn -B -Dnode=system package

- name: Save flow execution reports
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
id: upload_flow
with:
name: flow_execution_reports
Expand All @@ -62,12 +62,12 @@ jobs:
run: rm -rf static

- name: Download flow reports
uses: actions/download-artifact@cc203385981b70ca67e1cc392babf9cc229d5806 # v4.1.9
uses: actions/download-artifact@cc203385981b70ca67e1cc392babf9cc229d5806 # v4.1.9
with:
name: flow_execution_reports
path: static

- name: Commit
uses: stefanzweifel/git-auto-commit-action@e348103e9026cc0eee72ae06630dbe30c8bf7a79 # v5.1.0
uses: stefanzweifel/git-auto-commit-action@e348103e9026cc0eee72ae06630dbe30c8bf7a79 # v5.1.0
with:
branch: slim_pages
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Set up Node
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
with:
node-version: '14.15.1'
node-version: '18.19.1'
cache: 'npm'
cache-dependency-path: report/report-ng/package-lock.json

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class IconEmbedTest {
private static final String ICON_SERVICE_NAME = "icon-embed.service.ts";

private static final Pattern ICON_SERVICE_INJECTION_PATTERN = Pattern.compile(
"(\\S*?): IconEmbedService" );
"(\\S*?) = inject\\(IconEmbedService\\);" );

/**
* Matches SVG definitions out of {@value #ICON_SERVICE_NAME}, captures the icon
Expand Down Expand Up @@ -79,7 +79,7 @@ Stream<DynamicTest> icons() {
"Undefined icon '%s' in mat-icon invocation '%s'",
icon, usage.group() ) );
assertTrue( registered.contains( icon ), String.format(
"Uregistered icon '%s' in mat-icon invocation '%s'",
"Unregistered icon '%s' in mat-icon invocation '%s'",
icon, usage.group() ) );
}
}
Expand Down
18 changes: 0 additions & 18 deletions example/app-assert/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,24 +33,6 @@
<version>${project.version}</version>
</dependency>

<dependency>
<!-- browser interaction driver management -->
<groupId>io.github.bonigarcia</groupId>
<artifactId>webdrivermanager</artifactId>
<exclusions>
<exclusion>
<!-- This conflicts with the newer version that selenium needs -->
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</exclusion>
<exclusion>
<!-- Avoid incompatible slf4j -->
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
<!-- embedded database -->
<groupId>com.h2database</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeOptions;

import io.github.bonigarcia.wdm.WebDriverManager;

/**
* Handles the lifecycle of the chrome instance we use to test web UI. Add this
* class as an {@link ExtendWith} annotation on your test class that uses the
Expand Down Expand Up @@ -69,7 +67,6 @@ public static WebDriver get() {
+ "Only call Browser.get() in test classes with @ExtendWith(Browser.class) annotation" );
}

WebDriverManager.chromedriver().setup();
ChromeOptions options = new ChromeOptions();
if( !SHOW ) {
options.addArguments( "--headless=new" );
Expand Down
8 changes: 0 additions & 8 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -128,14 +128,6 @@
<version>4.13.0</version>
</dependency>

<dependency>
<!-- We use a headless chrome instance to test the report, this
provides automatic management of the drivers for that -->
<groupId>io.github.bonigarcia</groupId>
<artifactId>webdrivermanager</artifactId>
<version>6.0.1</version>
</dependency>

<dependency>
<!-- text diffs -->
<groupId>io.github.java-diff-utils</groupId>
Expand Down
15 changes: 0 additions & 15 deletions report/report-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -71,21 +71,6 @@
</exclusions>
</dependency>

<dependency>
<!-- We use a headless chrome instance to test the report, this
provides automatic management of the drivers for that -->
<groupId>io.github.bonigarcia</groupId>
<artifactId>webdrivermanager</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<!-- Avoid incompatible slf4j -->
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
<!-- This is how we drive the browser when testing the report -->
<groupId>org.seleniumhq.selenium</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -258,9 +258,9 @@ void chunkLoadingPath() throws Exception {
+ delta.getTarget().getLines().get( 0 ).length() )
.replaceAll( "\\d", "#" );

assertEquals( "),[])),a.u=e=>(###===e?\"comm",
assertEquals( "),[])),a.u=e=>(##===e?\"commo",
before, "raw resource runtime snippet" );
assertEquals( "),[])),a.u=e=>\"res/\"+(###===e?\"comm",
assertEquals( "),[])),a.u=e=>\"res/\"+(##===e?\"commo",
after, "written runtime snippet" );
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
import java.util.Objects;
import java.util.concurrent.TimeUnit;
import java.util.function.Function;
import java.util.stream.Stream;
Expand Down Expand Up @@ -237,8 +238,8 @@ protected <T extends AbstractSequence<T>> T navTo( String navItem,
driver.findElement( By.id( "menu_trigger" ) ).click();

Function<WebDriver, Stream<WebElement>> menuItems = dr -> dr
.findElement( By.className( "mat-menu-panel" ) )
.findElements( By.className( "mat-menu-item" ) )
.findElement( By.className( "mat-mdc-menu-panel" ) )
.findElements( By.className( "mat-mdc-menu-item" ) )
.stream();

new WebDriverWait( driver, Duration.ofSeconds( 1 ) )
Expand Down Expand Up @@ -266,7 +267,7 @@ protected <T extends AbstractSequence<T>> T navTo( String navItem,
*/
public <T extends AbstractSequence<T>> T tab( String name,
Function<AbstractSequence<S>, T> seqConstructor ) {
List<WebElement> tabs = driver.findElements( By.className( "mat-tab-label-content" ) );
List<WebElement> tabs = driver.findElements( By.className( "mdc-tab__text-label" ) );
tabs.stream()
.filter( e -> e.getText().startsWith( name ) )
.findFirst()
Expand Down Expand Up @@ -298,11 +299,13 @@ protected void waitForTabTransition() {
// wait for the tab transition to complete
new WebDriverWait( driver, Duration.ofSeconds( 3 ) )
.withMessage( () -> "Failed to find a relaxed tab body in:\n " + driver
.findElements( By.className( "mat-tab-body-content" ) ).stream()
.findElements( By.className( "mat-mdc-tab-body-content" ) ).stream()
.map( e -> e.getAttribute( "style" ) )
.collect( joining( "\n " ) ) )
.until( dr -> dr.findElements( By.className( "mat-tab-body-content" ) ).stream()
.anyMatch( e -> "transform: none;".equals( e.getAttribute( "style" ) ) ) );
.until( dr -> dr.findElements( By.className( "mat-mdc-tab-body-content" ) ).stream()
.map( e -> e.getAttribute( "style" ) )
.filter( Objects::nonNull )
.anyMatch( style -> style.contains( "transform: none;" ) ) );
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
import org.openqa.selenium.remote.RemoteWebDriver;
import org.slf4j.LoggerFactory;

import io.github.bonigarcia.wdm.WebDriverManager;

/**
* Handles the lifecycle of the chrome instance we use to test the report. Add
* this class as an {@link ExtendWith} annotation on your test class that uses
Expand Down Expand Up @@ -150,7 +148,6 @@ private enum Driver {
CHROME {
@Override
public WebDriver get() {
WebDriverManager.chromedriver().setup();
ChromeOptions options = new ChromeOptions();
if( !SHOW ) {
options.addArguments( "--headless=new" );
Expand Down Expand Up @@ -183,8 +180,6 @@ public WebDriver get() {
FIREFOX {
@Override
public WebDriver get() {
WebDriverManager.firefoxdriver().setup();

FirefoxOptions options = new FirefoxOptions();

if( !SHOW ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import org.junit.jupiter.api.Assertions;
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.ui.ExpectedCondition;
import org.openqa.selenium.support.ui.WebDriverWait;

import com.mastercard.test.flow.report.Copy;
Expand Down Expand Up @@ -280,6 +281,8 @@ private DiffSequence drag( String id, String from, String to ) {
.moveByOffset( 0, 5 ) // shrug
.moveToElement( items.get( to ) )
.release()
.moveByOffset( 0, 5 ) // shrug
.release()
.pause( 400 )
.build()
.perform();
Expand Down Expand Up @@ -505,9 +508,11 @@ public DiffSequence analysisDiffs( String... expected ) {

// wait for expansion to finish
new WebDriverWait( driver, ofSeconds( 2 ) )
.until( dr -> "visibility: visible;"
.equals( changed.findElement( By.className( "mat-expansion-panel-content" ) )
.getAttribute( "style" ) ) );
.until( (ExpectedCondition<Boolean>) dr -> {
List<WebElement> headers = changed
.findElements( By.className( "diff_display" ) );
return headers.stream().allMatch( WebElement::isDisplayed );
} );

WebElement changes = changed.findElement( By.id( "changes" ) );

Expand Down Expand Up @@ -539,11 +544,13 @@ public DiffSequence expandAnalysis( String diff ) {
.orElseThrow( () -> new IllegalStateException( "" ) );
diffPanel.findElement( By.tagName( "mat-expansion-panel-header" ) ).click();

// wait for expansion to finish
// wait for changes to load
new WebDriverWait( driver, ofSeconds( 2 ) )
.until( dr -> "visibility: visible;"
.equals( diffPanel.findElement( By.className( "mat-expansion-panel-content" ) )
.getAttribute( "style" ) ) );
.until( (ExpectedCondition<Boolean>) dr -> {
List<WebElement> headers = diffPanel
.findElements( By.className( "mat-mdc-list-item" ) );
return headers.stream().allMatch( WebElement::isDisplayed );
} );

return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -548,15 +548,15 @@ private static String summariseSVG( String svg ) {

private IndexSequence dragChip( String text, String sourceId, String destId ) {
WebElement source = driver.findElement( By.id( sourceId ) );
WebElement chip = source.findElements( By.tagName( "mat-chip" ) ).stream()
WebElement chip = source.findElements( By.tagName( "mat-chip-row" ) ).stream()
.filter( c -> text.equals( c.findElement( By.className( "tag_text" ) ).getText() ) )
.findFirst()
.orElseThrow( () -> new AssertionError( ""
+ "Couldn't find chip with text '" + text + "'\n"
+ "Have you called expandFilters()?" ) );
WebElement destination = driver
.findElement( By.id( destId ) )
.findElement( By.tagName( "mat-chip-list" ) );
.findElement( By.tagName( "mat-chip-grid" ) );
actions.moveToElement( chip )
.clickAndHold( chip )
.moveToElement( destination )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public LogSequence levels( String... levels ) {

List<WebElement> fields = driver.findElements( By.tagName( "mat-form-field" ) );
WebElement select = fields.stream()
.filter( e -> e.getText().endsWith( "Levels" ) )
.filter( e -> e.getText().contains( "Levels" ) )
.findFirst()
.orElse( null );

Expand Down Expand Up @@ -138,7 +138,7 @@ public LogSequence hasMessages( String... lines ) {
trace( "hasMessages", (Object[]) lines );
Assertions.assertEquals(
Copy.pasta( lines ),
Copy.pasta( driver.findElements( By.className( "mat-row" ) ).stream()
Copy.pasta( driver.findElements( By.className( "mat-mdc-row" ) ).stream()
.map( r -> r.getText().replace( '\n', ' ' ) ) ) );
return this;
}
Expand Down
6 changes: 3 additions & 3 deletions report/report-ng/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,18 +69,18 @@
"builder": "@angular-devkit/build-angular:dev-server",
"configurations": {
"production": {
"browserTarget": "report:build:production"
"buildTarget": "report:build:production"
},
"development": {
"browserTarget": "report:build:development"
"buildTarget": "report:build:development"
}
},
"defaultConfiguration": "development"
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "report:build"
"buildTarget": "report:build"
}
},
"test": {
Expand Down
Loading
Loading