Skip to content

Commit

Permalink
Complete e2e Flutter driver intgration with screenshots of dark & lig…
Browse files Browse the repository at this point in the history
…ht mode
  • Loading branch information
hmziqrs committed Oct 27, 2020
1 parent bdb285b commit 74df56a
Show file tree
Hide file tree
Showing 78 changed files with 1,204 additions and 21 deletions.
4 changes: 2 additions & 2 deletions lib/Navigator.dart
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import 'package:flutter/services.dart';
import 'package:flutter/material.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:invmovieconcept1/providers/Reservation.dart';
import 'package:invmovieconcept1/screens/SelectSeats/SelectSeats.dart';
import 'package:page_transition/page_transition.dart';
import 'package:provider/provider.dart';

import 'configs/Theme.dart' as theme;

import 'providers/Reservation.dart';
import 'providers/AppProvider.dart';

import 'screens/AboutDeveloper/AboutDeveloper.dart';
import 'screens/AboutDesigner/AboutDesigner.dart';
import 'screens/MovieDetail/MovieDetail.dart';
import 'screens/SelectSeats/SelectSeats.dart';
import 'screens/Reservation/Reservation.dart';
import 'screens/MyMovies/MyMovies.dart';
import 'screens/Download/Download.dart';
Expand Down
15 changes: 15 additions & 0 deletions lib/io/FakePlatform.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/*
This is probably the most horrible way to implement Platform Class for web.
But at the time of building this app current library("universal_io:1.0.0") is not wroking with latest flutter master branch. 23/Feb/2020
BTW I did spent quite lot of time debugging the error but couldn't find a good solution.
In the end it's what programming is about solving problems.
*/

class Platform {
static bool isWindows = false;
static bool isLinux = false;
static bool isMacOS = false;
static bool isAndroid = false;
static bool isFuchsia = false;
static bool isIOS = false;
}
1 change: 1 addition & 0 deletions lib/io/io.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export 'dart:io' if (dart.library.js) 'FakePlatform.dart' show Platform;
2 changes: 0 additions & 2 deletions lib/screens/AboutDeveloper/AboutDeveloper.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import 'package:flutter/material.dart';
import 'package:invmovieconcept1/configs/AppTheme.dart';

import 'package:invmovieconcept1/widgets/ScreenReveals/AvatarWithPunchHole.dart';
import 'package:invmovieconcept1/widgets/Screen/Screen.dart';
Expand All @@ -11,7 +10,6 @@ import 'Dimensions.dart';
class AboutDeveloperScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
print("SCREEN MOUNT ${AppTheme.background}");
Dimensions.init(context);

return Screen(
Expand Down
5 changes: 5 additions & 0 deletions lib/screens/AboutDeveloper/TestKeys.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const String scope = "AboutDeveloperScreen";

abstract class AboutDeveloperTestKeys {
static final String rootScroll = "$scope/rootScroll";
}
2 changes: 2 additions & 0 deletions lib/screens/AboutDeveloper/widgets/AboutDeveloperBody.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import 'package:invmovieconcept1/widgets/Buttons/Alpha.dart';
import 'package:invmovieconcept1/widgets/Header/Header.dart';
import 'package:invmovieconcept1/widgets/Banners/Alpha.dart';

import '../TestKeys.dart';
import 'AboutDeveloperMoreProjects.dart';

import '../messages/keys.dart';
Expand Down Expand Up @@ -55,6 +56,7 @@ class AboutDeveloperBody extends StatelessWidget {
child: Container(
width: AppDimensions.containerWidth,
child: ListView(
key: Key(AboutDeveloperTestKeys.rootScroll),
padding: EdgeInsets.zero,
children: <Widget>[
Header(
Expand Down
18 changes: 11 additions & 7 deletions lib/screens/Home/TestKeys.dart
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
const String scope = "HomeScreen";

abstract class HomeScreenTestKeys {
static final String modalContinueBtn = "$scope/modalContinueBtn";
static final String uiListBtn = '$scope/uiListBtn';
static final String aboutBtn = '$scope/aboutBtn';
static final String aboutDeveloperBtn = '$scope/aboutDeveloperBtn';
static final String downloadBtn = '$scope/downloadBtn';
static final String settingsBtn = '$scope/settingsBtn';
abstract class HomeTestKeys {
static final String drawerButton = "$scope/drawerButton";
static final String drawerCloseButton = "$scope/drawerCloseButton";

static final String searchButton = "$scope/searchButton";

static final String movieCardsBase = "$scope/movieCardsBase";

static getCard(int index) {
return "$scope/movieCard$index";
}
}
2 changes: 1 addition & 1 deletion lib/screens/Home/widgets/Drawer/HomeDrawer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ class _HomeDrawerState extends State<HomeDrawer> with AnimationMixin {
.map(
(entry) => HomeDrawerButton(
entry: entry,
onPressed: () => this.buttonHandler(entry.value["key"]),
baseAnimation: 1.0,
onPressed: () => this.buttonHandler(entry.value["key"]),
),
)
.toList(),
Expand Down
2 changes: 2 additions & 0 deletions lib/screens/Home/widgets/Drawer/HomeDrawerAvatar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import 'package:simple_animations/simple_animations.dart';
import 'package:invmovieconcept1/configs/AppDimensions.dart';

import '../../Dimensions.dart';
import '../../TestKeys.dart';
import '../../Theme.dart';

class HomeDrawerAvatar extends StatelessWidget {
Expand Down Expand Up @@ -75,6 +76,7 @@ class HomeDrawerAvatar extends StatelessWidget {
Flexible(child: Container()),
IconButton(
iconSize: AppDimensions.ratio * 10,
key: Key(HomeTestKeys.drawerCloseButton),
icon: Icon(
Icons.close,
color: HomeTheme.text,
Expand Down
1 change: 1 addition & 0 deletions lib/screens/Home/widgets/Drawer/HomeDrawerButton.dart
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ class HomeDrawerButton extends StatelessWidget {
horizontal: AppDimensions.padding * 2,
),
child: RaisedButton(
key: Key(entry.value["key"].toString()),
onPressed: this.onPressed,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(4.0),
Expand Down
15 changes: 7 additions & 8 deletions lib/screens/Home/widgets/HomeHeader.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import 'package:invmovieconcept1/configs/AppDimensions.dart';
import 'package:invmovieconcept1/UI.dart';

import '../FadeProvider.dart';
import '../TestKeys.dart';

class HomeHeader extends StatelessWidget {
@override
Expand All @@ -16,21 +17,19 @@ class HomeHeader extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
IconButton(
icon: Icon(Icons.menu),
hoverColor: Colors.transparent,
splashColor: Colors.transparent,
highlightColor: Colors.transparent,
hoverColor: Colors.transparent,
icon: Icon(
Icons.menu,
),
key: Key(HomeTestKeys.drawerButton),
onPressed: () => Scaffold.of(context).openDrawer(),
),
IconButton(
hoverColor: Colors.transparent,
splashColor: Colors.transparent,
icon: Icon(Icons.search_outlined),
highlightColor: Colors.transparent,
hoverColor: Colors.transparent,
icon: Icon(
Icons.search_outlined,
),
key: Key(HomeTestKeys.searchButton),
onPressed: () => Navigator.of(context).pushNamed("search"),
)
],
Expand Down
3 changes: 3 additions & 0 deletions lib/screens/Home/widgets/HomeMovieCards.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import 'package:invmovieconcept1/UI.dart';
import '../FadeProvider.dart';
import '../Dimensions.dart';
import '../provider.dart';
import '../TestKeys.dart';

enum AnimationMap {
offsetX,
Expand Down Expand Up @@ -101,6 +102,7 @@ class HomeMovieCards extends StatelessWidget {
child: SizeChangedLayoutNotifier(
child: PageView.builder(
clipBehavior: Clip.none,
key: Key(HomeTestKeys.movieCardsBase),
physics: BouncingScrollPhysics(),
itemCount: movies.list.length,
onPageChanged: (index) => state.activeMovieIndex != index
Expand Down Expand Up @@ -157,6 +159,7 @@ class HomeMovieCards extends StatelessWidget {
)
..translate(translateX),
child: GestureDetector(
key: Key(HomeTestKeys.getCard(index)),
onTap: () async {
if (index == state.activeMovieIndex) {
fadeState.setFade(true);
Expand Down
6 changes: 6 additions & 0 deletions lib/screens/MovieDetail/TestKeys.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
const String scope = "MovieDetailScreen";

abstract class MovieDetailTestKeys {
static final String scrollBody = "$scope/scrollBody";
static final String selectSeats = "$scope/selectSeats";
}
2 changes: 2 additions & 0 deletions lib/screens/MovieDetail/widgets/MovieDetailBody.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:invmovieconcept1/screens/MovieDetail/TestKeys.dart';
import 'package:supercharged/supercharged.dart';

import 'package:invmovieconcept1/models/MovieObject.dart';
Expand Down Expand Up @@ -53,6 +54,7 @@ class _MovieDetailBodyState extends State<MovieDetailBody> {
},
child: ListView(
controller: this.controller,
key: Key(MovieDetailTestKeys.scrollBody),
physics: MDScrollPhysics(parent: BouncingScrollPhysics()),
children: [
MovieInfoCard(movie: widget.movie),
Expand Down
3 changes: 3 additions & 0 deletions lib/screens/MovieDetail/widgets/MovieDetailSelectSeats.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ import 'package:invmovieconcept1/configs/AppTheme.dart';
import 'package:invmovieconcept1/configs/App.dart';

import '../messages/keys.dart';
import '../TestKeys.dart';
import '../provider.dart';

import 'MDReveal.dart';

class MovieDetailSelectSeats extends StatelessWidget {
Expand All @@ -35,6 +37,7 @@ class MovieDetailSelectSeats extends StatelessWidget {
bottom: AppDimensions.padding * 2,
),
child: RaisedButton(
key: Key(MovieDetailTestKeys.selectSeats),
onPressed: () async {
MovieDetailProvider.state(context).setFade(true);
await 360.milliseconds.delay;
Expand Down
7 changes: 7 additions & 0 deletions lib/screens/Reservation/TestKeys.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
const String scope = "ReservationScreen";

abstract class ReservationTestKeys {
static final String bookNow = "$scope/bookNow";
static final String ok = "$scope/ok";
static final String myMovies = "$scope/myMovies";
}
8 changes: 8 additions & 0 deletions lib/screens/Reservation/widgets/ReservationBookNow.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ import 'package:invmovieconcept1/configs/App.dart';

import '../messages/keys.dart';
import '../Dimensions.dart';
import '../TestKeys.dart';

final testKeys = {
ReservationScreenMessages.ok: ReservationTestKeys.ok,
ReservationScreenMessages.myMovies: ReservationTestKeys.myMovies,
};

class ReservationBookNow extends StatelessWidget {
onTap(BuildContext context) async {
Expand Down Expand Up @@ -84,6 +90,7 @@ class ReservationBookNow extends StatelessWidget {
.map(
(button) => Flexible(
child: TouchableOpacity(
key: Key(testKeys[button]),
onTap: () async {
Navigator.popUntil(
context,
Expand Down Expand Up @@ -145,6 +152,7 @@ class ReservationBookNow extends StatelessWidget {
child: Hero(
tag: "btn",
child: GestureDetector(
key: Key(ReservationTestKeys.bookNow),
onTap: () => this.onTap(context),
child: Container(
decoration: BoxDecoration(
Expand Down
20 changes: 20 additions & 0 deletions lib/screens/SelectSeats/TestKeys.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
const String scope = "SelectSeatsScreen";

abstract class SelectSeatsTestKeys {
static final String buyNow = "$scope/buyNow";

static String getDay(int index) {
return "$scope/selectSeatsDay$index";
}

static String getTime(int index) {
return "$scope/selectSeatsTime$index";
}

static String getSeat(
int x,
int y,
) {
return "$scope/selectSeats$x-$y";
}
}
2 changes: 2 additions & 0 deletions lib/screens/SelectSeats/widgets/BuyNow.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import 'package:invmovieconcept1/configs/TextStyles.dart';
import 'package:invmovieconcept1/configs/AppTheme.dart';
import 'package:invmovieconcept1/configs/App.dart';

import '../TestKeys.dart';
import '../messages/keys.dart';
import '../provider.dart';
import 'SSReveal.dart';
Expand Down Expand Up @@ -77,6 +78,7 @@ class SelectSeatsBuyNow extends StatelessWidget {
child: Material(
color: Colors.transparent,
child: GestureDetector(
key: Key(SelectSeatsTestKeys.buyNow),
onTap: () {
if (state.selectedSeats.isEmpty) {
return;
Expand Down
2 changes: 2 additions & 0 deletions lib/screens/SelectSeats/widgets/SelectDay.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import 'package:invmovieconcept1/configs/TextStyles.dart';
import 'package:invmovieconcept1/configs/AppTheme.dart';

import '../Dimensions.dart';
import '../TestKeys.dart';
import '../provider.dart';
import 'SSReveal.dart';

Expand Down Expand Up @@ -38,6 +39,7 @@ class SelectSeatsDay extends StatelessWidget {
final isSelected = selectedDay != null && selectedDay == date;
final textColor = isSelected ? Colors.white : Colors.black;
return GestureDetector(
key: Key(SelectSeatsTestKeys.getDay(index)),
onTap: () {
if (isReserved) {
return;
Expand Down
4 changes: 4 additions & 0 deletions lib/screens/SelectSeats/widgets/SelectSeatsGrid.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import 'package:invmovieconcept1/configs/AppDimensions.dart';
import 'package:invmovieconcept1/configs/AppTheme.dart';

import '../Dimensions.dart';
import '../TestKeys.dart';
import '../provider.dart';
import 'SSReveal.dart';

Expand Down Expand Up @@ -55,6 +56,9 @@ class SelectSeatsGrid extends StatelessWidget {
}

return GestureDetector(
key: Key(
SelectSeatsTestKeys.getSeat(xEntry.key, yEntry.key),
),
onTap: () {
if (isReserved || this.isReserved) {
return;
Expand Down
2 changes: 2 additions & 0 deletions lib/screens/SelectSeats/widgets/SelectTime.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import 'package:invmovieconcept1/configs/TextStyles.dart';
import 'package:invmovieconcept1/configs/AppTheme.dart';

import '../Dimensions.dart';
import '../TestKeys.dart';
import '../provider.dart';
import 'SSReveal.dart';

Expand Down Expand Up @@ -38,6 +39,7 @@ class SelectSeatsTime extends StatelessWidget {
final textColor = isSelected ? Colors.white : Colors.black;

return GestureDetector(
key: Key(SelectSeatsTestKeys.getTime(index)),
onTap: () {
if (this.isReserved) {
return;
Expand Down
7 changes: 6 additions & 1 deletion lib/widgets/Header/Header.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import 'package:invmovieconcept1/Utils.dart';

import 'package:invmovieconcept1/widgets/Buttons/BackIcon.dart';

import 'TestKeys.dart';

class Header extends StatelessWidget {
Header({
this.label,
Expand Down Expand Up @@ -38,7 +40,10 @@ class Header extends StatelessWidget {
color: Colors.transparent,
child: Row(
children: [
BackIconButton(),
Container(
key: Key(HeaderWidgetKey.backButton),
child: BackIconButton(),
),
Container(
padding: EdgeInsets.all(AppDimensions.padding * 2),
child: Text(
Expand Down
3 changes: 3 additions & 0 deletions lib/widgets/Header/StackFade.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import 'package:flutter/material.dart';
import 'package:invmovieconcept1/configs/AppDimensions.dart';
import 'package:invmovieconcept1/configs/AppTheme.dart';

import 'TestKeys.dart';

class StackFadeHeader extends StatelessWidget {
StackFadeHeader({
this.children,
Expand All @@ -20,6 +22,7 @@ class StackFadeHeader extends StatelessWidget {
Widget build(BuildContext context) {
final List<Widget> toRender = [
InkResponse(
key: Key(HeaderWidgetKey.backButton),
onTap: () => this.onTap(context),
child: Padding(
padding: EdgeInsets.all(AppDimensions.padding * 2),
Expand Down
5 changes: 5 additions & 0 deletions lib/widgets/Header/TestKeys.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const String scope = "HeaderWidget";

abstract class HeaderWidgetKey {
static final String backButton = "$scope/drawerButton";
}
Loading

0 comments on commit 74df56a

Please sign in to comment.