Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
1743eab
Initial copy of e2e plugin renamed to espresso
collinjackson Nov 26, 2019
0bf791e
Switch to a new project based on template plugin
collinjackson Nov 26, 2019
f47c5a4
Update example app to be a button app
collinjackson Nov 26, 2019
45bf214
switch to Java
collinjackson Nov 26, 2019
195bb22
Add example Espresso test
collinjackson Nov 26, 2019
fded8ad
Midpoint check-in while addressing dependency errors
collinjackson Nov 26, 2019
60da0af
Demonstration of Espresso tests passing
collinjackson Nov 26, 2019
4f65053
All tests pass
collinjackson Nov 26, 2019
7c77635
Add shared preferences integration test
collinjackson Nov 26, 2019
86f133c
Fix test to match internal version
collinjackson Nov 26, 2019
02adfc8
Tests pass for shared prefs plugin
collinjackson Nov 26, 2019
f343591
Open source Espresso files
collinjackson Nov 26, 2019
521eb6c
License
collinjackson Dec 6, 2019
f2e0e56
SDK constraints
collinjackson Dec 6, 2019
6b86f04
Update README, changelog, remove test
collinjackson Dec 6, 2019
0b70161
Revert shared_preferences
collinjackson Dec 6, 2019
ce9de53
Update README.md
collinjackson Dec 7, 2019
cc2ebe5
Update README to make it clear this package is Android-only
collinjackson Dec 9, 2019
11b38af
Update licenses
collinjackson Dec 9, 2019
da89fee
Merge remote-tracking branch 'cj/new_espresso_plugin' into new_espres…
collinjackson Dec 9, 2019
211e358
remove commented dependencies
collinjackson Dec 9, 2019
b823741
More README updates
collinjackson Dec 9, 2019
5a1d274
Add a click test
collinjackson Dec 9, 2019
226a0d6
Fix build error
collinjackson Dec 9, 2019
2d0d9a1
More README updates
collinjackson Dec 9, 2019
0a2b5ab
fix file that wasn't meant to be checked in
collinjackson Dec 9, 2019
56360ff
Update README
collinjackson Dec 9, 2019
e3d340c
Merge remote-tracking branch 'origin/master' into new_espresso_plugin
collinjackson Dec 10, 2019
5377d27
Fix build failure
collinjackson Dec 10, 2019
8663ebd
Update README.md
collinjackson Dec 10, 2019
f69d012
Update README to clarify that iOS example is for the bots.
collinjackson Jan 9, 2020
a33410d
Code review feedback on plaintext traffic
collinjackson Jan 9, 2020
3a00269
Update README.md
collinjackson Jan 9, 2020
e5c1ae1
reformat
collinjackson Jan 9, 2020
5bf41b2
update pubspec.yaml
collinjackson Jan 9, 2020
9a85ad9
remove unused test
collinjackson Jan 9, 2020
d69e407
reformat
collinjackson Jan 9, 2020
6b6ff85
Merge remote-tracking branch 'origin/master' into new_espresso_plugin
collinjackson Jan 9, 2020
acef95e
Merge remote-tracking branch 'cj/new_espresso_plugin' into new_espres…
collinjackson Jan 9, 2020
a5a9c46
Fix analyzer issues
collinjackson Jan 9, 2020
8b6542b
fix ios build
collinjackson Jan 9, 2020
d18b2a0
remove lib/espresso.dart
collinjackson Jan 9, 2020
8129481
reformat
collinjackson Jan 9, 2020
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
Prev Previous commit
Next Next commit
Update example app to be a button app
  • Loading branch information
collinjackson committed Dec 6, 2019
commit f47c5a4c6036fecb969284d2b803b0137df82a15
123 changes: 89 additions & 34 deletions packages/espresso/example/lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,56 +1,111 @@
import 'package:flutter/material.dart';
import 'dart:async';

import 'package:flutter/services.dart';
import 'package:espresso/espresso.dart';

void main() => runApp(MyApp());

class MyApp extends StatefulWidget {
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
_MyAppState createState() => _MyAppState();
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
// This is the theme of your application.
//
// Try running your application with "flutter run". You'll see the
// application has a blue toolbar. Then, without quitting the app, try
// changing the primarySwatch below to Colors.green and then invoke
// "hot reload" (press "r" in the console where you ran "flutter run",
// or simply save your changes to "hot reload" in a Flutter IDE).
// Notice that the counter didn't reset back to zero; the application
// is not restarted.
primarySwatch: Colors.blue,
),
home: MyHomePage(title: 'Flutter Demo Home Page'),
);
}
}

class _MyAppState extends State<MyApp> {
String _platformVersion = 'Unknown';
class MyHomePage extends StatefulWidget {
MyHomePage({Key key, this.title}) : super(key: key);

// This widget is the home page of your application. It is stateful, meaning
// that it has a State object (defined below) that contains fields that affect
// how it looks.

// This class is the configuration for the state. It holds the values (in this
// case the title) provided by the parent (in this case the App widget) and
// used by the build method of the State. Fields in a Widget subclass are
// always marked "final".

final String title;

@override
void initState() {
super.initState();
initPlatformState();
}
_MyHomePageState createState() => _MyHomePageState();
}

// Platform messages are asynchronous, so we initialize in an async method.
Future<void> initPlatformState() async {
String platformVersion;
// Platform messages may fail, so we use a try/catch PlatformException.
try {
platformVersion = await Espresso.platformVersion;
} on PlatformException {
platformVersion = 'Failed to get platform version.';
}

// If the widget was removed from the tree while the asynchronous platform
// message was in flight, we want to discard the reply rather than calling
// setState to update our non-existent appearance.
if (!mounted) return;
class _MyHomePageState extends State<MyHomePage> {
int _counter = 0;

void _incrementCounter() {
setState(() {
_platformVersion = platformVersion;
// This call to setState tells the Flutter framework that something has
// changed in this State, which causes it to rerun the build method below
// so that the display can reflect the updated values. If we changed
// _counter without calling setState(), then the build method would not be
// called again, and so nothing would appear to happen.
_counter++;
});
}

@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: const Text('Plugin example app'),
),
body: Center(
child: Text('Running on: $_platformVersion\n'),
// This method is rerun every time setState is called, for instance as done
// by the _incrementCounter method above.
//
// The Flutter framework has been optimized to make rerunning build methods
// fast, so that you can just rebuild anything that needs updating rather
// than having to individually change instances of widgets.
return Scaffold(
appBar: AppBar(
// Here we take the value from the MyHomePage object that was created by
// the App.build method, and use it to set our appbar title.
title: Text(widget.title),
),
body: Center(
// Center is a layout widget. It takes a single child and positions it
// in the middle of the parent.
child: Column(
// Column is also a layout widget. It takes a list of children and
// arranges them vertically. By default, it sizes itself to fit its
// children horizontally, and tries to be as tall as its parent.
//
// Invoke "debug painting" (press "p" in the console, choose the
// "Toggle Debug Paint" action from the Flutter Inspector in Android
// Studio, or the "Toggle Debug Paint" command in Visual Studio Code)
// to see the wireframe for each widget.
//
// Column has various properties to control how it sizes itself and
// how it positions its children. Here we use mainAxisAlignment to
// center the children vertically; the main axis here is the vertical
// axis because Columns are vertical (the cross axis would be
// horizontal).
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Text(
'You have pushed the button this many times:',
),
Text(
'$_counter',
style: Theme.of(context).textTheme.display1,
),
],
),
),
floatingActionButton: FloatingActionButton(
onPressed: _incrementCounter,
tooltip: 'Increment',
child: Icon(Icons.add),
), // This trailing comma makes auto-formatting nicer for build methods.
);
}
}
40 changes: 1 addition & 39 deletions packages/espresso/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: espresso
description: A new flutter plugin project.
description: Java classes for testing Flutter apps using Espresso.
version: 0.0.1
author:
homepage:
Expand All @@ -15,46 +15,8 @@ dev_dependencies:
flutter_test:
sdk: flutter

# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec

# The following section is specific to Flutter.
flutter:
# This section identifies this Flutter project as a plugin project.
# The androidPackage and pluginClass identifiers should not ordinarily
# be modified. They are used by the tooling to maintain consistency when
# adding or updating assets for this project.
plugin:
androidPackage: com.example.espresso
pluginClass: EspressoPlugin

# To add assets to your plugin package, add an assets section, like this:
# assets:
# - images/a_dot_burr.jpeg
# - images/a_dot_ham.jpeg
#
# For details regarding assets in packages, see
# https://flutter.dev/assets-and-images/#from-packages
#
# An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.dev/assets-and-images/#resolution-aware.

# To add custom fonts to your plugin package, add a fonts section here,
# in this "flutter" section. Each entry in this list should have a
# "family" key with the font family name, and a "fonts" key with a
# list giving the asset and other descriptors for the font. For
# example:
# fonts:
# - family: Schyler
# fonts:
# - asset: fonts/Schyler-Regular.ttf
# - asset: fonts/Schyler-Italic.ttf
# style: italic
# - family: Trajan Pro
# fonts:
# - asset: fonts/TrajanPro.ttf
# - asset: fonts/TrajanPro_Bold.ttf
# weight: 700
#
# For details regarding fonts in packages, see
# https://flutter.dev/custom-fonts/#from-packages