This commit is contained in:
Hillel Coren 2021-05-03 16:47:25 +03:00
parent 06a84d39f9
commit a32f8c8993
4 changed files with 20 additions and 16 deletions

View File

@ -559,6 +559,7 @@ class _DrawerTileState extends State<DrawerTile> {
),
title: Text(
widget.title,
key: ValueKey('menu_${widget.title}'),
style: Theme.of(context).textTheme.bodyText1.copyWith(
fontSize: 16,
color: textColor,

View File

@ -6,10 +6,10 @@ import 'quotes_it_test.dart' as quotes;
import 'vendors_it_test.dart' as vendors;
void main() {
login.main();
products.runTestSuite(batchMode: true);
//login.main();
//products.runTestSuite(batchMode: true);
//clients.runTestSuite(batchMode: true);
//invoices.runTestSuite(batchMode: true);
invoices.runTestSuite(batchMode: true);
//quotes.runTestSuite(batchMode: true);
//vendors.runTestSuite(batchMode: true);
}

View File

@ -18,8 +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 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);
@ -106,7 +106,6 @@ void runTestSuite({bool batchMode = false}) {
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,
@ -160,8 +159,8 @@ void runTestSuite({bool batchMode = false}) {
await selectAction(driver, localization.enterPayment);
await driver.tap(find.text(localization.save));
// "Completed" status
await driver.waitFor(
find.text(localization.paymentStatus4.toUpperCase()));
await driver
.waitFor(find.text(localization.paymentStatus4.toUpperCase()));
if (await isMobile(driver)) {
await driver.tap(find.pageBack());

View File

@ -43,25 +43,29 @@ Future<void> login(FlutterDriver driver,
}
*/
if (selfHosted) {
print('Tap ' + localization.selfhosted.toUpperCase());
await driver.tap(find.text(localization.selfhosted.toUpperCase()));
}
print('Fill in email/password');
await fillTextFields(driver, <String, dynamic>{
localization.email: loginEmail,
localization.password: loginPassword,
});
if (selfHosted) {
print('Fill in url/secret');
await fillTextFields(driver, <String, dynamic>{
localization.url: loginUrl,
'${localization.secret} (${localization.optional})': loginSecret,
});
}
print(localization.emailSignIn);
print('Tap ' + localization.emailSignIn);
await driver.tap(find.text(localization.emailSignIn));
if (loginEmail.isNotEmpty) {
print('Wait for ' + localization.overview);
await driver.waitFor(find.text(localization.overview),
timeout: new Duration(seconds: 60));
}
@ -97,7 +101,7 @@ Future<void> viewSection({FlutterDriver driver, String name}) async {
await driver.tap(find.byTooltip(Keys.openAppDrawer));
}
await driver.tap(find.text(name));
await driver.tap(find.byValueKey('menu_' + name));
}
Future<void> fillTextField(