Restored tests
This commit is contained in:
parent
096855bb45
commit
77b910c70f
|
|
@ -442,7 +442,7 @@ class _AppBottomBarState extends State<AppBottomBar> {
|
|||
),
|
||||
if (widget.statuses.isNotEmpty)
|
||||
IconButton(
|
||||
tooltip: localization.filter,
|
||||
tooltip: localization.status,
|
||||
icon: Icon(Icons.filter),
|
||||
onPressed: _showFilterStatusSheet,
|
||||
color: store.state
|
||||
|
|
@ -453,7 +453,7 @@ class _AppBottomBarState extends State<AppBottomBar> {
|
|||
),
|
||||
if (widget.customValues1.isNotEmpty)
|
||||
IconButton(
|
||||
tooltip: localization.filter,
|
||||
tooltip: localization.filteredBy,
|
||||
icon: Icon(Icons.looks_one),
|
||||
onPressed: _showFilterCustom1Sheet,
|
||||
color: store.state
|
||||
|
|
@ -464,7 +464,7 @@ class _AppBottomBarState extends State<AppBottomBar> {
|
|||
),
|
||||
if (widget.customValues2.isNotEmpty)
|
||||
IconButton(
|
||||
tooltip: localization.filter,
|
||||
tooltip: localization.filteredBy,
|
||||
icon: Icon(Icons.looks_two),
|
||||
onPressed: _showFilterCustom2Sheet,
|
||||
color: store.state
|
||||
|
|
@ -475,7 +475,7 @@ class _AppBottomBarState extends State<AppBottomBar> {
|
|||
),
|
||||
if (widget.customValues3.isNotEmpty)
|
||||
IconButton(
|
||||
tooltip: localization.filter,
|
||||
tooltip: localization.filteredBy,
|
||||
icon: Icon(Icons.looks_3),
|
||||
onPressed: _showFilterCustom3Sheet,
|
||||
color: store.state
|
||||
|
|
@ -486,7 +486,7 @@ class _AppBottomBarState extends State<AppBottomBar> {
|
|||
),
|
||||
if (widget.customValues4.isNotEmpty)
|
||||
IconButton(
|
||||
tooltip: localization.filter,
|
||||
tooltip: localization.filteredBy,
|
||||
icon: Icon(Icons.looks_4),
|
||||
onPressed: _showFilterCustom4Sheet,
|
||||
color: store.state
|
||||
|
|
|
|||
|
|
@ -128,6 +128,7 @@ class VendorEditDetailsState extends State<VendorEditDetails> {
|
|||
FormCard(
|
||||
children: <Widget>[
|
||||
DecoratedFormField(
|
||||
formKey: ValueKey(localization.name),
|
||||
autofocus: true,
|
||||
controller: _nameController,
|
||||
validator: (String val) => val == null || val.isEmpty
|
||||
|
|
|
|||
|
|
@ -1,17 +1,15 @@
|
|||
/*
|
||||
import 'clients_it_test.dart' as clients;
|
||||
import 'invoices_it_test.dart' as invoices;
|
||||
import 'login_it_test.dart' as login;
|
||||
import 'products_it_test.dart' as products;
|
||||
//import 'quotes_it_test.dart' as quotes;
|
||||
//import 'vendors_it_test.dart' as vendors;
|
||||
import 'quotes_it_test.dart' as quotes;
|
||||
import 'vendors_it_test.dart' as vendors;
|
||||
|
||||
void main() {
|
||||
login.main();
|
||||
products.runTestSuite(batchMode: true);
|
||||
//products.runTestSuite(batchMode: true);
|
||||
clients.runTestSuite(batchMode: true);
|
||||
invoices.runTestSuite(batchMode: true);
|
||||
//invoices.runTestSuite(batchMode: true);
|
||||
//quotes.runTestSuite(batchMode: true);
|
||||
//vendors.runTestSuite(batchMode: true);
|
||||
}
|
||||
*/
|
||||
vendors.runTestSuite(batchMode: true);
|
||||
}
|
||||
|
|
@ -98,7 +98,7 @@ void runTestSuite({bool batchMode = false}) {
|
|||
test('Archive/delete client test', () async {
|
||||
await testArchiveAndDelete(
|
||||
driver: driver,
|
||||
name: updatedName,
|
||||
rowText: updatedName,
|
||||
archivedMessage: localization.archivedClient,
|
||||
deletedMessage: localization.deletedClient,
|
||||
restoredMessage: localization.restoredClient);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/*
|
||||
import 'package:flutter_driver/driver_extension.dart';
|
||||
import 'package:invoiceninja_flutter/main.dart' as app;
|
||||
|
||||
|
|
@ -6,5 +5,4 @@ void main() {
|
|||
// This line enables the extension
|
||||
enableFlutterDriverExtension();
|
||||
app.main(isTesting: true);
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
|
@ -1,4 +1,3 @@
|
|||
/*
|
||||
import 'package:faker/faker.dart';
|
||||
import 'package:flutter_driver/flutter_driver.dart';
|
||||
import 'package:test/test.dart';
|
||||
|
|
@ -70,7 +69,6 @@ void runTestSuite({bool batchMode = false}) {
|
|||
|
||||
// Create a new invoice
|
||||
test('Add a new invoice', () async {
|
||||
|
||||
print('Tap new invoice');
|
||||
await driver.tap(find.byTooltip(localization.newInvoice));
|
||||
|
||||
|
|
@ -106,7 +104,7 @@ void runTestSuite({bool batchMode = false}) {
|
|||
|
||||
// Await for Debouncer
|
||||
await Future<dynamic>.delayed(Duration(milliseconds: 500));
|
||||
await driver.tap(find.text(localization.done));
|
||||
await driver.tap(find.text(localization.done.toUpperCase()));
|
||||
await driver.tap(find.text(localization.details));
|
||||
|
||||
} else {
|
||||
|
|
@ -151,6 +149,7 @@ void runTestSuite({bool batchMode = false}) {
|
|||
test('Archive/delete invoice test', () async {
|
||||
await testArchiveAndDelete(
|
||||
driver: driver,
|
||||
rowText: clientName,
|
||||
archivedMessage: localization.archivedInvoice,
|
||||
deletedMessage: localization.deletedInvoice,
|
||||
restoredMessage: localization.restoredInvoice);
|
||||
|
|
@ -170,5 +169,4 @@ void runTestSuite({bool batchMode = false}) {
|
|||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
|
@ -1,4 +1,3 @@
|
|||
/*
|
||||
// Import Flutter Driver API
|
||||
import 'dart:async';
|
||||
|
||||
|
|
@ -58,4 +57,3 @@ void main() {
|
|||
});
|
||||
});
|
||||
}
|
||||
*/
|
||||
|
|
@ -1,4 +1,3 @@
|
|||
/*
|
||||
import 'package:flutter_driver/driver_extension.dart';
|
||||
import 'package:invoiceninja_flutter/main.dart' as app;
|
||||
|
||||
|
|
@ -6,5 +5,4 @@ void main() {
|
|||
// This line enables the extension
|
||||
enableFlutterDriverExtension();
|
||||
app.main(isTesting: true);
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
|
@ -1,4 +1,3 @@
|
|||
/*
|
||||
import 'package:faker/faker.dart';
|
||||
import 'package:flutter_driver/flutter_driver.dart';
|
||||
import 'package:test/test.dart';
|
||||
|
|
@ -110,9 +109,10 @@ void runTestSuite({bool batchMode = false}) {
|
|||
});
|
||||
|
||||
// Archive the edited product
|
||||
test('Archieve/delete product test', () async {
|
||||
test('Archive/delete product test', () async {
|
||||
await testArchiveAndDelete(
|
||||
driver: driver,
|
||||
rowText: updatedProductKey,
|
||||
archivedMessage: localization.archivedProduct,
|
||||
deletedMessage: localization.deletedProduct,
|
||||
restoredMessage: localization.restoredProduct);
|
||||
|
|
@ -123,4 +123,3 @@ void runTestSuite({bool batchMode = false}) {
|
|||
});
|
||||
});
|
||||
}
|
||||
*/
|
||||
|
|
@ -1,4 +1,3 @@
|
|||
/*
|
||||
import 'package:flutter_driver/driver_extension.dart';
|
||||
import 'package:invoiceninja_flutter/main.dart' as app;
|
||||
|
||||
|
|
@ -6,5 +5,4 @@ void main() {
|
|||
// This line enables the extension
|
||||
enableFlutterDriverExtension();
|
||||
app.main(isTesting: true);
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
|
@ -1,4 +1,3 @@
|
|||
/*
|
||||
import 'package:faker/faker.dart';
|
||||
import 'package:flutter_driver/flutter_driver.dart';
|
||||
import 'package:test/test.dart';
|
||||
|
|
@ -19,6 +18,8 @@ void runTestSuite({bool batchMode = false}) {
|
|||
final poNumber =
|
||||
faker.randomGenerator.integer(999999, min: 100000).toString();
|
||||
final productKey = makeUnique(faker.food.cuisine());
|
||||
final clientKey = faker.randomGenerator.integer(999999, min: 100000)
|
||||
.toString();
|
||||
final description = faker.lorem.sentences(5).toString();
|
||||
final cost =
|
||||
faker.randomGenerator.decimal(min: 50, scale: 10).toStringAsFixed(2);
|
||||
|
|
@ -72,27 +73,48 @@ void runTestSuite({bool batchMode = false}) {
|
|||
await driver.tap(find.byTooltip(localization.newQuote));
|
||||
|
||||
print('Create new client: $clientName');
|
||||
await driver.tap(find.byValueKey(localization.client));
|
||||
if (await isMobile(driver)) {
|
||||
await driver.tap(find.byValueKey(Keys.clientPickerEmptyKey));
|
||||
}
|
||||
await driver.tap(find.byTooltip(localization.createNew));
|
||||
|
||||
print('Fill the client form');
|
||||
await fillTextField(
|
||||
driver: driver, field: localization.name, value: clientName);
|
||||
await fillTextFields(driver, <String, String>{
|
||||
localization.name: clientName,
|
||||
localization.idNumber: clientKey
|
||||
});
|
||||
// Await for Debouncer
|
||||
await Future<dynamic>.delayed(Duration(milliseconds: 500));
|
||||
await driver.tap(find.text(localization.save));
|
||||
|
||||
// Await for Screen change
|
||||
await driver.waitFor(find.text(localization.newQuote));
|
||||
|
||||
print('Fill the quote form');
|
||||
await driver.tap(find.byTooltip(localization.addItem));
|
||||
await driver.tap(find.byTooltip(localization.createNew));
|
||||
if(await isMobile(driver)) {
|
||||
await driver.tap(find.byTooltip(localization.addItem));
|
||||
await driver.tap(find.byTooltip(localization.createNew));
|
||||
|
||||
await fillTextFields(driver, <String, String>{
|
||||
localization.product: productKey,
|
||||
localization.description: description,
|
||||
localization.unitCost: cost,
|
||||
localization.quantity: '1',
|
||||
});
|
||||
await fillTextFields(driver, <String, String>{
|
||||
localization.product: productKey,
|
||||
localization.description: description,
|
||||
localization.unitCost: cost,
|
||||
localization.quantity: '1',
|
||||
});
|
||||
|
||||
await driver.tap(find.text(localization.done));
|
||||
await driver.tap(find.text(localization.details));
|
||||
// Await for Debouncer
|
||||
await Future<dynamic>.delayed(Duration(milliseconds: 500));
|
||||
await driver.tap(find.text(localization.done.toUpperCase()));
|
||||
await driver.tap(find.text(localization.details));
|
||||
|
||||
} else {
|
||||
await fillTextFields(driver, <String, String>{
|
||||
getLineItemKey('name', 0): productKey,
|
||||
getLineItemKey('description', 0): description,
|
||||
getLineItemKey('cost', 0): cost,
|
||||
getLineItemKey('quantity', 0): '1'
|
||||
});
|
||||
}
|
||||
|
||||
await fillAndSaveForm(driver, <String, String>{
|
||||
localization.poNumber: poNumber,
|
||||
|
|
@ -127,21 +149,10 @@ void runTestSuite({bool batchMode = false}) {
|
|||
test('Archive/delete quote test', () async {
|
||||
await testArchiveAndDelete(
|
||||
driver: driver,
|
||||
rowText: clientName,
|
||||
archivedMessage: localization.archivedQuote,
|
||||
deletedMessage: localization.deletedQuote,
|
||||
restoredMessage: localization.restoredQuote);
|
||||
});
|
||||
|
||||
// Convert to invoice
|
||||
test('Convert to invoice', () async {
|
||||
await selectAction(driver, localization.convert);
|
||||
await driver.waitFor(find.byType('InvoiceView'));
|
||||
|
||||
if (await isMobile(driver)) {
|
||||
await driver.tap(find.pageBack());
|
||||
await driver.tap(find.pageBack());
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
|
@ -148,27 +148,28 @@ Future<void> fillAndSaveForm(FlutterDriver driver, Map<String, dynamic> values,
|
|||
Future<void> testArchiveAndDelete(
|
||||
{FlutterDriver driver,
|
||||
String archivedMessage,
|
||||
String name,
|
||||
String rowText,
|
||||
String deletedMessage,
|
||||
String restoredMessage}) async {
|
||||
final localization = TestLocalization('en');
|
||||
final mobile = await isMobile(driver);
|
||||
|
||||
if (!mobile) {
|
||||
// Show archived and deleted entries on tablet/web
|
||||
await driver.tap(find.byTooltip(localization.filter));
|
||||
await driver.tap(find.text(localization.archived));
|
||||
await driver.tap(find.text(localization.deleted));
|
||||
await driver.tap(find.byTooltip(localization.filter));
|
||||
}
|
||||
|
||||
print('Archive record');
|
||||
await selectAction(driver, localization.archive);
|
||||
await driver.waitFor(find.text(archivedMessage));
|
||||
//await driver.waitFor(find.text(localization.archived));
|
||||
|
||||
print('Show archived/deleted records');
|
||||
await driver.tap(find.byTooltip(localization.filter));
|
||||
await driver.tap(find.text(localization.archived));
|
||||
await driver.tap(find.text(localization.deleted));
|
||||
await driver.tap(find.byTooltip(localization.filter));
|
||||
|
||||
print('Restore record');
|
||||
await driver.tap(find.text(name));
|
||||
if (mobile)
|
||||
await driver.scrollUntilVisible(find.byType('ListView'), find.text(rowText),
|
||||
dyScroll: -300);
|
||||
await driver.tap(find.text(rowText));
|
||||
await selectAction(driver, localization.restore);
|
||||
await driver.waitFor(find.text(restoredMessage));
|
||||
await driver.waitForAbsent(find.byType('Snackbar'));
|
||||
|
|
@ -179,7 +180,10 @@ Future<void> testArchiveAndDelete(
|
|||
//await driver.waitFor(find.text(localization.deleted));
|
||||
|
||||
print('Restore record');
|
||||
await driver.tap(find.text(name));
|
||||
if (mobile)
|
||||
await driver.scrollUntilVisible(find.byType('ListView'), find.text(rowText),
|
||||
dyScroll: -300);
|
||||
await driver.tap(find.text(rowText));
|
||||
await selectAction(driver, localization.restore);
|
||||
await driver.waitFor(find.text(restoredMessage));
|
||||
await driver.waitForAbsent(find.byType('Snackbar'));
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/*
|
||||
import 'package:flutter_driver/driver_extension.dart';
|
||||
import 'package:invoiceninja_flutter/main.dart' as app;
|
||||
|
||||
|
|
@ -6,5 +5,4 @@ void main() {
|
|||
// This line enables the extension
|
||||
enableFlutterDriverExtension();
|
||||
app.main(isTesting: true);
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
|
@ -1,4 +1,3 @@
|
|||
/*
|
||||
import 'package:faker/faker.dart';
|
||||
import 'package:flutter_driver/flutter_driver.dart';
|
||||
import 'package:test/test.dart';
|
||||
|
|
@ -68,7 +67,6 @@ void runTestSuite({bool batchMode = false}) {
|
|||
await fillAndSaveForm(driver, <String, dynamic>{
|
||||
localization.name: name,
|
||||
});
|
||||
print('Form filled');
|
||||
|
||||
if (await isMobile(driver)) {
|
||||
print('Click back');
|
||||
|
|
@ -99,6 +97,7 @@ void runTestSuite({bool batchMode = false}) {
|
|||
test('Archieve/delete vendor test', () async {
|
||||
await testArchiveAndDelete(
|
||||
driver: driver,
|
||||
rowText: updatedName,
|
||||
archivedMessage: localization.archivedVendor,
|
||||
deletedMessage: localization.deletedVendor,
|
||||
restoredMessage: localization.restoredVendor);
|
||||
|
|
@ -108,5 +107,4 @@ void runTestSuite({bool batchMode = false}) {
|
|||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
*/
|
||||
}
|
||||
Loading…
Reference in New Issue