Tests
This commit is contained in:
parent
06a84d39f9
commit
a32f8c8993
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,16 +16,16 @@ void runTestSuite({bool batchMode = false}) {
|
|||
|
||||
final clientName = makeUnique(faker.company.name());
|
||||
final poNumber =
|
||||
faker.randomGenerator.integer(999999, min: 100000).toString();
|
||||
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);
|
||||
faker.randomGenerator.decimal(min: 50, scale: 10).toStringAsFixed(2);
|
||||
|
||||
final updatedPoNumber =
|
||||
faker.randomGenerator.integer(999999, min: 100000).toString();
|
||||
faker.randomGenerator.integer(999999, min: 100000).toString();
|
||||
|
||||
setUpAll(() async {
|
||||
localization = TestLocalization('en');
|
||||
|
|
@ -73,7 +73,7 @@ void runTestSuite({bool batchMode = false}) {
|
|||
await driver.tap(find.byTooltip(localization.newInvoice));
|
||||
|
||||
print('Create new client: $clientName');
|
||||
if(await isMobile(driver)) {
|
||||
if (await isMobile(driver)) {
|
||||
await driver.tap(find.byValueKey(Keys.clientPickerEmptyKey));
|
||||
}
|
||||
await driver.tap(find.byTooltip(localization.createNew));
|
||||
|
|
@ -91,7 +91,7 @@ void runTestSuite({bool batchMode = false}) {
|
|||
await driver.waitFor(find.text(localization.newInvoice));
|
||||
|
||||
print('Fill the invoice form');
|
||||
if(await isMobile(driver)) {
|
||||
if (await isMobile(driver)) {
|
||||
await driver.tap(find.byTooltip(localization.addItem));
|
||||
await driver.tap(find.byTooltip(localization.createNew));
|
||||
|
||||
|
|
@ -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());
|
||||
|
|
|
|||
|
|
@ -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(
|
||||
|
|
|
|||
Loading…
Reference in New Issue