-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
1,098 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,193 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_test/flutter_test.dart'; | ||
import 'package:organizei/components/botao.dart'; | ||
import 'package:organizei/components/dialogs/login/entrarDialog.dart'; | ||
import 'package:organizei/components/dialogs/tarefas/tarefaCadastroDialog.dart'; | ||
|
||
void main() { | ||
group('ATIVIDADE', () { | ||
testWidgets('Todos os campos vazios', (WidgetTester tester) async { | ||
await tester.pumpWidget( | ||
MaterialApp( | ||
home: Material( | ||
child: Builder( | ||
builder: (BuildContext context) { | ||
return Botao( | ||
key: Key("keyTesteButton"), | ||
texto: 'Salvar', | ||
cor: const Color(0xFF74C198), | ||
clicar: () { | ||
criarTarefa(context); | ||
}); | ||
}, | ||
), | ||
), | ||
), | ||
); | ||
|
||
await tester.tap(find.byKey(ValueKey("keyTesteButton"))); | ||
await tester.pump(); | ||
await tester.ensureVisible(find.byKey(Key("keySalvarButton"))); | ||
await tester.pumpAndSettle(); | ||
await tester.tap(find.byKey(ValueKey("keySalvarButton"))); | ||
}); | ||
|
||
testWidgets('Nome vazio', (WidgetTester tester) async { | ||
await tester.pumpWidget(MaterialApp( | ||
home: Material( | ||
child: Builder( | ||
builder: (BuildContext context) { | ||
return Botao( | ||
key: Key("keyTesteButton"), | ||
texto: 'clicar', | ||
cor: const Color(0xFF74C198), | ||
clicar: () { | ||
criarTarefa(context); | ||
}); | ||
}, | ||
), | ||
), | ||
)); | ||
|
||
await tester.tap(find.byKey(ValueKey("keyTesteButton"))); | ||
await tester.pump(); | ||
|
||
await tester.ensureVisible(find.byKey(Key("keySalvarButton"))); | ||
await tester.pumpAndSettle(); | ||
|
||
//await tester.enterText(find.byKey(ValueKey("keyTextSenha")), "senha"); | ||
|
||
await tester.tap(find.byKey(ValueKey("keySalvarButton"))); | ||
}); | ||
|
||
testWidgets('Data incial vazia', (WidgetTester tester) async { | ||
await tester.pumpWidget(MaterialApp( | ||
home: Material( | ||
child: Builder( | ||
builder: (BuildContext context) { | ||
return Botao( | ||
key: Key("keyTesteButton"), | ||
texto: 'clicar', | ||
cor: const Color(0xFF74C198), | ||
clicar: () { | ||
criarTarefa(context); | ||
}); | ||
}, | ||
), | ||
), | ||
)); | ||
|
||
await tester.tap(find.byKey(ValueKey("keyTesteButton"))); | ||
await tester.pump(); | ||
|
||
await tester.ensureVisible(find.byKey(Key("keySalvarButton"))); | ||
await tester.pumpAndSettle(); | ||
|
||
await tester.tap(find.byKey(ValueKey("keySalvarButton"))); | ||
}); | ||
|
||
testWidgets('Data final vazia', (WidgetTester tester) async { | ||
await tester.pumpWidget(MaterialApp( | ||
home: Material( | ||
child: Builder( | ||
builder: (BuildContext context) { | ||
return Botao( | ||
key: Key("keyTesteButton"), | ||
texto: 'clicar', | ||
cor: const Color(0xFF74C198), | ||
clicar: () { | ||
criarTarefa(context); | ||
}); | ||
}, | ||
), | ||
), | ||
)); | ||
|
||
await tester.tap(find.byKey(ValueKey("keyTesteButton"))); | ||
await tester.pump(); | ||
|
||
await tester.ensureVisible(find.byKey(Key("keySalvarButton"))); | ||
await tester.pumpAndSettle(); | ||
|
||
await tester.tap(find.byKey(ValueKey("keySalvarButton"))); | ||
}); | ||
|
||
testWidgets('Observação vazia', (WidgetTester tester) async { | ||
await tester.pumpWidget(MaterialApp( | ||
home: Material( | ||
child: Builder( | ||
builder: (BuildContext context) { | ||
return Botao( | ||
key: Key("keyTesteButton"), | ||
texto: 'clicar', | ||
cor: const Color(0xFF74C198), | ||
clicar: () { | ||
criarTarefa(context); | ||
}); | ||
}, | ||
), | ||
), | ||
)); | ||
|
||
await tester.tap(find.byKey(ValueKey("keyTesteButton"))); | ||
await tester.pump(); | ||
|
||
await tester.ensureVisible(find.byKey(Key("keySalvarButton"))); | ||
await tester.pumpAndSettle(); | ||
|
||
await tester.tap(find.byKey(ValueKey("keySalvarButton"))); | ||
}); | ||
|
||
testWidgets('Prioridade vazia', (WidgetTester tester) async { | ||
await tester.pumpWidget(MaterialApp( | ||
home: Material( | ||
child: Builder( | ||
builder: (BuildContext context) { | ||
return Botao( | ||
key: Key("keyTesteButton"), | ||
texto: 'clicar', | ||
cor: const Color(0xFF74C198), | ||
clicar: () { | ||
criarTarefa(context); | ||
}); | ||
}, | ||
), | ||
), | ||
)); | ||
|
||
await tester.tap(find.byKey(ValueKey("keyTesteButton"))); | ||
await tester.pump(); | ||
|
||
await tester.ensureVisible(find.byKey(Key("keySalvarButton"))); | ||
await tester.pumpAndSettle(); | ||
|
||
await tester.tap(find.byKey(ValueKey("keySalvarButton"))); | ||
}); | ||
|
||
testWidgets('Cor vazia', (WidgetTester tester) async { | ||
await tester.pumpWidget(MaterialApp( | ||
home: Material( | ||
child: Builder( | ||
builder: (BuildContext context) { | ||
return Botao( | ||
key: Key("keyTesteButton"), | ||
texto: 'clicar', | ||
cor: const Color(0xFF74C198), | ||
clicar: () { | ||
criarTarefa(context); | ||
}); | ||
}, | ||
), | ||
), | ||
)); | ||
|
||
await tester.tap(find.byKey(ValueKey("keyTesteButton"))); | ||
await tester.pump(); | ||
|
||
await tester.ensureVisible(find.byKey(Key("keySalvarButton"))); | ||
await tester.pumpAndSettle(); | ||
|
||
await tester.tap(find.byKey(ValueKey("keySalvarButton"))); | ||
}); | ||
}); | ||
} |
Oops, something went wrong.