Marco Papula
Committed by David PHAM-VAN

Add integration tests for wrapWidget

... ... @@ -3,6 +3,7 @@
## 3.3.0
- Add wrapWidget helper
- Add integration tests for wrapWidget
## 3.2.1
... ...
... ... @@ -252,6 +252,7 @@ class MyAppState extends State<MyApp> {
onPressed: printingInfo?.canShare ?? false ? _sharePdf : null,
),
RaisedButton(
key: const Key('screenshot'),
child: const Text('Print Screenshot'),
onPressed: (printingInfo?.canPrint ?? false) && !kIsWeb
? _printScreen
... ...
... ... @@ -17,6 +17,9 @@ dependencies:
dev_dependencies:
flutter_test:
sdk: flutter
flutter_driver:
sdk: flutter
test:
dependency_overrides:
printing:
... ...
/*
* Copyright (C) 2017, David PHAM-VAN <dev.nfet.net@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import 'package:flutter_driver/driver_extension.dart';
import 'package:printing_example/main.dart' as app;
void main() {
// Enables flutter_driver extension
enableFlutterDriverExtension();
// Call the `main()` function of the app
app.main();
}
... ...
/*
* Copyright (C) 2017, David PHAM-VAN <dev.nfet.net@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import 'package:flutter_driver/flutter_driver.dart';
import 'package:test/test.dart';
void main() {
group('wrapWidget integration tests', () {
FlutterDriver driver;
final SerializableFinder screenshotFinder = find.byValueKey('screenshot');
setUpAll(() async {
driver = await FlutterDriver.connect();
});
tearDownAll(() {
if (driver != null) {
driver.close();
}
});
test('renders Widget as Image', () async {
await driver.tap(screenshotFinder);
});
});
}
... ...