This repository has been archived by the owner on Mar 29, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e55ddf2
commit 68f16c7
Showing
43 changed files
with
1,479 additions
and
584 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,4 +1,4 @@ | ||
{ | ||
"flutterSdkVersion": "3.7.3", | ||
"flutterSdkVersion": "3.10.6", | ||
"flavors": {} | ||
} | ||
} |
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,10 +1,33 @@ | ||
# This file tracks properties of this Flutter project. | ||
# Used by Flutter tool to assess capabilities and perform upgrades etc. | ||
# | ||
# This file should be version controlled and should not be manually edited. | ||
# This file should be version controlled. | ||
|
||
version: | ||
revision: d8cbb80206db06d151206f8b599b7dde5a386a2d | ||
channel: beta | ||
revision: 9944297138845a94256f1cf37beb88ff9a8e811a | ||
channel: stable | ||
|
||
project_type: plugin | ||
|
||
# Tracks metadata for the flutter migrate command | ||
migration: | ||
platforms: | ||
- platform: root | ||
create_revision: 9944297138845a94256f1cf37beb88ff9a8e811a | ||
base_revision: 9944297138845a94256f1cf37beb88ff9a8e811a | ||
- platform: android | ||
create_revision: 9944297138845a94256f1cf37beb88ff9a8e811a | ||
base_revision: 9944297138845a94256f1cf37beb88ff9a8e811a | ||
- platform: ios | ||
create_revision: 9944297138845a94256f1cf37beb88ff9a8e811a | ||
base_revision: 9944297138845a94256f1cf37beb88ff9a8e811a | ||
|
||
# User provided section | ||
|
||
# List of Local paths (relative to this file) that should be | ||
# ignored by the migrate tool. | ||
# | ||
# Files that are not part of the templates will be ignored by default. | ||
unmanaged_files: | ||
- 'lib/main.dart' | ||
- 'ios/Runner.xcodeproj/project.pbxproj' |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{ | ||
"flutterSdkVersion": "3.7.3", | ||
"flutterSdkVersion": "3.10.6", | ||
"flavors": {} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,130 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_test/flutter_test.dart'; | ||
import 'package:integration_test/integration_test.dart'; | ||
import 'package:nend_plugin/nend_plugin.dart'; | ||
import 'package:nend_plugin_example/banner.dart' as app; | ||
|
||
void main() { | ||
IntegrationTestWidgetsFlutterBinding.ensureInitialized(); | ||
|
||
group('Banner ad tests', () { | ||
testWidgets('320x50 banner ad test', (tester) async { | ||
app.main(); | ||
await tester.pumpAndSettle(); | ||
|
||
var banner = find.text('loadAd: 320x50'); | ||
await tester.tap(banner); | ||
await tester.pump(new Duration(seconds: 3)); | ||
|
||
var playIcon = find.byIcon(Icons.play_arrow).at(1); | ||
await tester.tap(playIcon); | ||
await tester.pumpAndSettle(); | ||
|
||
final bannerAd = | ||
find.byType(BannerAd).first.evaluate().single.widget as BannerAd; | ||
expect(bannerAd.adjustSize, false); | ||
expect(bannerAd.bannerSize, BannerSize.type320x50); | ||
|
||
final loadCounter = find.text("onLoaded: 2"); | ||
expect(loadCounter, findsOneWidget); | ||
final receiveCounter = find.text("onReceived: 2"); | ||
expect(receiveCounter, findsOneWidget); | ||
|
||
/// Default interval for auto reload is 60 sec. | ||
await tester.pump(new Duration(seconds: 30)); | ||
final receiveIncrementCounter = find.text("onReceived: 3"); | ||
expect(receiveIncrementCounter, findsOneWidget); | ||
}); | ||
|
||
testWidgets('320x100 banner ad test', (tester) async { | ||
app.main(); | ||
await tester.pumpAndSettle(); | ||
|
||
var banner = find.text('loadAd: 320x100'); | ||
await tester.tap(banner); | ||
await tester.pump(new Duration(seconds: 3)); | ||
|
||
var playIcon = find.byIcon(Icons.play_arrow).at(1); | ||
await tester.tap(playIcon); | ||
await tester.pumpAndSettle(); | ||
|
||
final bannerAd = | ||
find.byType(BannerAd).first.evaluate().single.widget as BannerAd; | ||
expect(bannerAd.adjustSize, false); | ||
expect(bannerAd.bannerSize, BannerSize.type320x100); | ||
|
||
final loadCounter = find.text("onLoaded: 2"); | ||
expect(loadCounter, findsOneWidget); | ||
final receiveCounter = find.text("onReceived: 2"); | ||
expect(receiveCounter, findsOneWidget); | ||
}); | ||
|
||
testWidgets('300x100 banner ad test', (tester) async { | ||
app.main(); | ||
await tester.pumpAndSettle(); | ||
|
||
var banner = find.text('loadAd: 300x100'); | ||
await tester.tap(banner); | ||
await tester.pump(new Duration(seconds: 3)); | ||
|
||
var playIcon = find.byIcon(Icons.play_arrow).at(1); | ||
await tester.tap(playIcon); | ||
await tester.pumpAndSettle(); | ||
|
||
final bannerAd = | ||
find.byType(BannerAd).first.evaluate().single.widget as BannerAd; | ||
expect(bannerAd.adjustSize, false); | ||
expect(bannerAd.bannerSize, BannerSize.type300x100); | ||
|
||
final loadCounter = find.text("onLoaded: 2"); | ||
expect(loadCounter, findsOneWidget); | ||
final receiveCounter = find.text("onReceived: 2"); | ||
expect(receiveCounter, findsOneWidget); | ||
}); | ||
|
||
testWidgets('300x250 banner ad test', (tester) async { | ||
app.main(); | ||
await tester.pumpAndSettle(); | ||
|
||
var banner = find.text('loadAd: 300x250'); | ||
await tester.tap(banner); | ||
await tester.pump(new Duration(seconds: 3)); | ||
|
||
var playIcon = find.byIcon(Icons.play_arrow).at(1); | ||
await tester.tap(playIcon); | ||
await tester.pumpAndSettle(); | ||
|
||
final bannerAd = | ||
find.byType(BannerAd).first.evaluate().single.widget as BannerAd; | ||
expect(bannerAd.adjustSize, false); | ||
expect(bannerAd.bannerSize, BannerSize.type300x250); | ||
|
||
final loadCounter = find.text("onLoaded: 2"); | ||
expect(loadCounter, findsOneWidget); | ||
final receiveCounter = find.text("onReceived: 2"); | ||
expect(receiveCounter, findsOneWidget); | ||
}); | ||
|
||
testWidgets('728x90 banner ad test', (tester) async { | ||
app.main(); | ||
await tester.pumpAndSettle(); | ||
|
||
var banner = find.text('loadAd: 728x90'); | ||
await tester.tap(banner); | ||
await tester.pump(new Duration(seconds: 3)); | ||
|
||
var playIcon = find.byIcon(Icons.play_arrow).at(1); | ||
await tester.tap(playIcon); | ||
|
||
await tester.pumpAndSettle(); | ||
final bannerAd = | ||
find.byType(BannerAd).first.evaluate().single.widget as BannerAd; | ||
expect(bannerAd.adjustSize, false); | ||
expect(bannerAd.bannerSize, BannerSize.type728x90); | ||
|
||
/// Assuming that the testing device is NOT tablet. | ||
final failedToLoadCounter = find.text("onFailedToLoad: 2"); | ||
expect(failedToLoadCounter, findsOneWidget); | ||
}); | ||
}); | ||
} |
47 changes: 47 additions & 0 deletions
47
example/integration_test/interstitial_integration_test.dart
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,47 @@ | ||
import 'package:flutter_test/flutter_test.dart'; | ||
import 'package:integration_test/integration_test.dart'; | ||
import 'package:nend_plugin_example/interstitial.dart' as app; | ||
|
||
void main() { | ||
IntegrationTestWidgetsFlutterBinding.ensureInitialized(); | ||
|
||
group('Interstitial ad tests', () { | ||
testWidgets('Show interstitial ad 1', (tester) async { | ||
app.main(); | ||
await tester.pumpAndSettle(); | ||
|
||
var loadInterstitial1 = find.textContaining('Load').first; | ||
await tester.tap(loadInterstitial1); | ||
await tester.pump(new Duration(seconds: 3)); | ||
|
||
final loadCounter = find.text("onLoaded: 1"); | ||
expect(loadCounter, findsOneWidget); | ||
|
||
var showInterstitial1 = find.textContaining('Show').first; | ||
await tester.tap(showInterstitial1); | ||
await tester.pumpAndSettle(); | ||
|
||
final showCounter = find.text("onShown: 1"); | ||
expect(showCounter, findsOneWidget); | ||
}); | ||
|
||
testWidgets('Show interstitial ad 2', (tester) async { | ||
app.main(); | ||
await tester.pumpAndSettle(); | ||
|
||
var loadInterstitial2 = find.textContaining('Load').at(1); | ||
await tester.tap(loadInterstitial2); | ||
await tester.pump(new Duration(seconds: 3)); | ||
|
||
final loadCounter = find.text("onLoaded: 1"); | ||
expect(loadCounter, findsOneWidget); | ||
|
||
var showInterstitial2 = find.textContaining('Show').at(1); | ||
await tester.tap(showInterstitial2); | ||
await tester.pumpAndSettle(); | ||
|
||
final showCounter = find.text("onShown: 1"); | ||
expect(showCounter, findsOneWidget); | ||
}); | ||
}); | ||
} |
25 changes: 25 additions & 0 deletions
25
example/integration_test/interstitial_video_integration_test.dart
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,25 @@ | ||
import 'package:flutter_test/flutter_test.dart'; | ||
import 'package:integration_test/integration_test.dart'; | ||
import 'package:nend_plugin_example/interstitial_video.dart' as app; | ||
|
||
void main() { | ||
IntegrationTestWidgetsFlutterBinding.ensureInitialized(); | ||
|
||
group('Interstitial video ad tests', () { | ||
testWidgets('Show interstitial video ad', (tester) async { | ||
app.main(); | ||
await tester.pumpAndSettle(); | ||
|
||
var loadInterstitialVideo = find.textContaining('Load').first; | ||
await tester.tap(loadInterstitialVideo); | ||
await tester.pump(new Duration(seconds: 10)); | ||
|
||
final loadCounter = find.text("onLoaded: 1"); | ||
expect(loadCounter, findsOneWidget); | ||
|
||
var showInterstitialVideo = find.textContaining('Show').first; | ||
await tester.tap(showInterstitialVideo); | ||
await tester.pump(new Duration(seconds: 10)); | ||
}); | ||
}); | ||
} |
25 changes: 25 additions & 0 deletions
25
example/integration_test/rewarded_video_integration_test.dart
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,25 @@ | ||
import 'package:flutter_test/flutter_test.dart'; | ||
import 'package:integration_test/integration_test.dart'; | ||
import 'package:nend_plugin_example/rewarded_video.dart' as app; | ||
|
||
void main() { | ||
IntegrationTestWidgetsFlutterBinding.ensureInitialized(); | ||
|
||
group('Rewarded video ad tests', () { | ||
testWidgets('Show rewarded video ad', (tester) async { | ||
app.main(); | ||
await tester.pumpAndSettle(); | ||
|
||
var loadRewardedVideo = find.textContaining('Load').first; | ||
await tester.tap(loadRewardedVideo); | ||
await tester.pump(new Duration(seconds: 10)); | ||
|
||
final loadCounter = find.text("onLoaded: 1"); | ||
expect(loadCounter, findsOneWidget); | ||
|
||
var showRewardedVideo = find.textContaining('Show').first; | ||
await tester.tap(showRewardedVideo); | ||
await tester.pump(new Duration(seconds: 10)); | ||
}); | ||
}); | ||
} |
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.