-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from priyanshuverma-dev/feat-tests
Feat tests
- Loading branch information
Showing
13 changed files
with
170 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,8 @@ | ||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
- master | ||
push: | ||
branches: | ||
- main | ||
- master | ||
- dev | ||
|
||
|
||
name: "Build & Release" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
- master | ||
push: | ||
branches: | ||
- main | ||
- master | ||
|
||
|
||
name: "Integration Tests" | ||
|
||
jobs: | ||
run_tests: | ||
name: Run Integration Tests | ||
runs-on: windows-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-java@v3 | ||
with: | ||
java-version: '11' | ||
distribution: 'temurin' | ||
- uses: subosito/flutter-action@v2 | ||
with: | ||
channel: stable | ||
flutter-version: '3.19.5' | ||
- name: Test Connectivity | ||
run: | | ||
ping jiosaavn.com | ||
- name: Dependencies install | ||
run: flutter pub get | ||
- name: Test For Windows | ||
run: flutter test -d windows integration_test\app_test.dart | ||
- name: Build For Windows | ||
run: flutter build windows |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_test/flutter_test.dart'; | ||
import 'package:sangeet/core/widgets/top_details.dart'; | ||
import 'package:sangeet/functions/explore/widgets/browse_card.dart'; | ||
import 'package:integration_test/integration_test.dart'; | ||
|
||
import 'package:sangeet/main.dart' as app; | ||
|
||
void main() { | ||
group("e2e Testing", () { | ||
IntegrationTestWidgetsFlutterBinding.ensureInitialized(); | ||
|
||
testWidgets('Explore Cards Working', (WidgetTester tester) async { | ||
String mediaName = ""; | ||
String mediaTopName = ""; | ||
Finder backBtn; | ||
await app.main(); | ||
await tester.pumpAndSettle(); | ||
|
||
final albumCard = find.byKey(const Key("album_card_0")); | ||
mediaName = (albumCard.evaluate().first.widget as BrowseCard).title; | ||
await tester.tap(albumCard); | ||
await tester.pumpAndSettle(); | ||
|
||
mediaTopName = (find.byKey(const Key("album_top")).evaluate().first.widget | ||
as TopDetailsContainer) | ||
.title; | ||
|
||
backBtn = find.byKey(const Key("back_btn")); | ||
await tester.tap(backBtn); | ||
await tester.pumpAndSettle(); | ||
expect(mediaTopName, mediaName); | ||
|
||
final chartCard = find.byKey(const Key("chart_card_0")); | ||
await tester.ensureVisible(chartCard); | ||
mediaName = (chartCard.evaluate().first.widget as BrowseCard).title; | ||
await tester.tap(chartCard); | ||
await tester.pumpAndSettle(); | ||
|
||
mediaTopName = (find.byKey(const Key("chart_top")).evaluate().first.widget | ||
as TopDetailsContainer) | ||
.title; | ||
|
||
backBtn = find.byKey(const Key("back_btn")); | ||
await tester.tap(backBtn); | ||
await tester.pumpAndSettle(); | ||
expect(mediaTopName, mediaName); | ||
|
||
final playlistCard = find.byKey(const Key("playlist_card_0")); | ||
await tester.ensureVisible(playlistCard); | ||
mediaName = (playlistCard.evaluate().first.widget as BrowseCard).title; | ||
await tester.tap(playlistCard); | ||
await tester.pumpAndSettle(); | ||
|
||
mediaTopName = (find | ||
.byKey(const Key("playlist_top")) | ||
.evaluate() | ||
.first | ||
.widget as TopDetailsContainer) | ||
.title; | ||
|
||
backBtn = find.byKey(const Key("back_btn")); | ||
await tester.tap(backBtn); | ||
await tester.pumpAndSettle(); | ||
expect(mediaTopName, mediaName); | ||
}); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.