-
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
6 changed files
with
121 additions
and
32 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
// Use o IntelliSense para saber mais sobre os atributos possíveis. | ||
// Focalizar para exibir as descrições dos atributos existentes. | ||
// Para obter mais informações, acesse: https://go.microsoft.com/fwlink/?linkid=830387 | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "organizei-mobile", | ||
"request": "launch", | ||
"type": "dart" | ||
}, | ||
{ | ||
"name": "organizei-mobile (profile mode)", | ||
"request": "launch", | ||
"type": "dart", | ||
"flutterMode": "profile" | ||
}, | ||
{ | ||
"name": "organizei-mobile (release mode)", | ||
"request": "launch", | ||
"type": "dart", | ||
"flutterMode": "release" | ||
} | ||
] | ||
} |
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,89 @@ | ||
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'; | ||
|
||
void main() { | ||
group('LOGIN', () { | ||
testWidgets('Email e CPF/CNPJ vazio', (WidgetTester tester) async { | ||
await tester.pumpWidget( | ||
MaterialApp( | ||
home: Material( | ||
child: Builder( | ||
builder: (BuildContext context) { | ||
return Botao( | ||
key: Key("keyEntrarButton"), | ||
texto: 'Entrar', | ||
cor: const Color(0xFF74C198), | ||
clicar: () { | ||
print('aaaa'); | ||
entrar(context); | ||
}); | ||
}, | ||
), | ||
), | ||
), | ||
); | ||
//Entra no widget | ||
|
||
//Pressiona o botão de "Entrar" | ||
await tester.tap(find.byKey(ValueKey("keyEntrarButton"))); | ||
|
||
//Atualiza o estado da tela | ||
await tester.pump(); | ||
|
||
expect(find.text('e-mail'), findsOneWidget); | ||
expect(find.text('senha'), findsOneWidget); | ||
|
||
//Verifica se ambas validações aparecem em tela | ||
// expect(find.text('Informe o CPF/CNPJ'), findsOneWidget); | ||
// expect(find.text('Informe o Email'), findsOneWidget); | ||
}); | ||
testWidgets('Senha vazia', (WidgetTester tester) async { | ||
await tester.pumpWidget(MaterialApp( | ||
home: Material( | ||
child: Builder( | ||
builder: (BuildContext context) { | ||
return Botao( | ||
key: Key("keyEntrarButton"), | ||
texto: 'clicar', | ||
cor: const Color(0xFF74C198), | ||
clicar: () { | ||
print('aaaa'); | ||
entrar(context); | ||
}); | ||
}, | ||
), | ||
), | ||
)); | ||
|
||
await tester.tap(find.byKey(ValueKey("keyEntrarButton"))); | ||
await tester.pump(); | ||
|
||
await tester.enterText(find.text('nome'), "[email protected]"); | ||
|
||
// await tester.tap(find.byKey(ValueKey("BB"))); | ||
|
||
//await tester.enterText(find.byKey(ValueKey("BB")), "[email protected]"); | ||
// await tester.tap(find.text('Entrar')); | ||
//await tester.tap(find.byKey(ValueKey("BB"))); | ||
//await tester.tap(find.text('Entrar')); | ||
|
||
// await tester.enterText( | ||
// find.byKey(ValueKey("keyTextFieldEmail")), "[email protected]"); | ||
|
||
//await tester.enterText(find.text('e-mail'), "[email protected]"); | ||
|
||
// await tester.enterText( | ||
// find.byKey(ValueKey("keyTextFieldEmail")), "[email protected]"); | ||
// await tester.tap(find.byKey(ValueKey("keyEntrarButton"))); | ||
// await tester.pump(); | ||
// expect(find.text('Informe o CPF/CNPJ'), findsOneWidget); | ||
// expect(find.text('Informe o Email'), findsNothing); | ||
}); | ||
|
||
//Verifica se ambas validações aparecem em tela | ||
// expect(find.text('Informe o CPF/CNPJ'), findsOneWidget); | ||
// expect(find.text('Informe o Email'), findsOneWidget); | ||
}); | ||
} |
This file was deleted.
Oops, something went wrong.