feat: implement magic link sign in (#5036)

This commit is contained in:
Lucas.Xu
2024-04-11 16:33:28 +08:00
committed by GitHub
parent b7b4ea2da1
commit 1597f7d94c
81 changed files with 599 additions and 473 deletions

View File

@ -32,7 +32,7 @@ void main() {
);
tester.expectToSeeText(LocaleKeys.signIn_loginStartWithAnonymous.tr());
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
await tester.expectToSeeHomePageWithGetStartedPage();
// reanme the name of the anon user

View File

@ -18,7 +18,7 @@ void main() {
group('board add row test:', () {
testWidgets('from header', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
await tester.createNewPageWithNameUnderParent(layout: ViewLayoutPB.Board);
@ -61,7 +61,7 @@ void main() {
testWidgets('from footer', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
await tester.createNewPageWithNameUnderParent(layout: ViewLayoutPB.Board);

View File

@ -15,7 +15,7 @@ void main() {
testWidgets('move row to another group', (tester) async {
const card1Name = 'Card 1';
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
await tester.createNewPageWithNameUnderParent(layout: ViewLayoutPB.Board);
final card1 = find.ancestor(

View File

@ -16,7 +16,7 @@ void main() {
group('board group options:', () {
testWidgets('expand/collapse hidden groups', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
await tester.createNewPageWithNameUnderParent(layout: ViewLayoutPB.Board);
final collapseFinder = find.byFlowySvg(FlowySvgs.pull_left_outlined_s);
@ -45,7 +45,7 @@ void main() {
testWidgets('hide first group, and show it again', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
await tester.createNewPageWithNameUnderParent(layout: ViewLayoutPB.Board);
// Tap the options of the first group
@ -81,7 +81,7 @@ void main() {
testWidgets('delete a group', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
await tester.createNewPageWithNameUnderParent(layout: ViewLayoutPB.Board);
expect(tester.widgetList(find.byType(BoardColumnHeader)).length, 4);

View File

@ -7,8 +7,8 @@ import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import '../../shared/util.dart';
import '../../shared/database_test_op.dart';
import '../../shared/util.dart';
void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
@ -16,7 +16,7 @@ void main() {
group('board row test', () {
testWidgets('delete item in ToDo card', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
await tester.createNewPageWithNameUnderParent(layout: ViewLayoutPB.Board);
const name = 'Card 1';
@ -34,7 +34,7 @@ void main() {
testWidgets('duplicate item in ToDo card', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
await tester.createNewPageWithNameUnderParent(layout: ViewLayoutPB.Board);
const name = 'Card 1';
@ -52,7 +52,7 @@ void main() {
testWidgets('add new group', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
await tester.createNewPageWithNameUnderParent(layout: ViewLayoutPB.Board);
// assert number of groups

View File

@ -14,7 +14,7 @@ void main() {
group('calendar', () {
testWidgets('update calendar layout', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
await tester.createNewPageWithNameUnderParent(
layout: ViewLayoutPB.Calendar,
@ -36,7 +36,7 @@ void main() {
testWidgets('calendar start from day setting', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
// Create calendar view
const name = 'calendar';
@ -69,7 +69,7 @@ void main() {
testWidgets('creating and editing calendar events', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
// Create the calendar view
await tester.createNewPageWithNameUnderParent(
@ -153,7 +153,7 @@ void main() {
const customTitle = "EventTitleCustom";
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
// Create the calendar view
await tester.createNewPageWithNameUnderParent(
@ -194,7 +194,7 @@ void main() {
testWidgets('rescheduling events', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
// Create the calendar view
await tester.createNewPageWithNameUnderParent(

View File

@ -13,7 +13,7 @@ void main() {
group('edit grid cell:', () {
testWidgets('text', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
await tester.createNewPageWithNameUnderParent(layout: ViewLayoutPB.Grid);
@ -36,7 +36,7 @@ void main() {
// multiple text cell
testWidgets('multiple text cells', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
await tester.createNewPageWithNameUnderParent(
name: 'my grid',
layout: ViewLayoutPB.Grid,
@ -74,7 +74,7 @@ void main() {
testWidgets('number', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
await tester.createNewPageWithNameUnderParent(layout: ViewLayoutPB.Grid);
@ -132,7 +132,7 @@ void main() {
testWidgets('checkbox', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
await tester.createNewPageWithNameUnderParent(layout: ViewLayoutPB.Grid);
@ -150,7 +150,7 @@ void main() {
testWidgets('created time', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
await tester.createNewPageWithNameUnderParent(layout: ViewLayoutPB.Grid);
@ -168,7 +168,7 @@ void main() {
testWidgets('last modified time', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
await tester.createNewPageWithNameUnderParent(layout: ViewLayoutPB.Grid);
@ -186,7 +186,7 @@ void main() {
testWidgets('date time', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
await tester.createNewPageWithNameUnderParent(layout: ViewLayoutPB.Grid);
@ -282,7 +282,7 @@ void main() {
testWidgets('single select', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
const fieldType = FieldType.SingleSelect;
@ -361,7 +361,7 @@ void main() {
];
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
await tester.createNewPageWithNameUnderParent(layout: ViewLayoutPB.Grid);
@ -444,7 +444,7 @@ void main() {
testWidgets('checklist', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
await tester.createNewPageWithNameUnderParent(layout: ViewLayoutPB.Grid);

View File

@ -13,7 +13,7 @@ void main() {
group('database field settings', () {
testWidgets('field visibility', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
await tester.createNewPageWithNameUnderParent(layout: ViewLayoutPB.Grid);
await tester.tapCreateLinkedDatabaseViewButton(DatabaseLayoutPB.Grid);

View File

@ -17,7 +17,7 @@ void main() {
group('grid field editor:', () {
testWidgets('rename existing field', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
await tester.createNewPageWithNameUnderParent(layout: ViewLayoutPB.Grid);
@ -34,7 +34,7 @@ void main() {
testWidgets('update field type of existing field', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
await tester.createNewPageWithNameUnderParent(layout: ViewLayoutPB.Grid);
@ -50,7 +50,7 @@ void main() {
testWidgets('create a field and rename it', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
// create a new grid
await tester.createNewPageWithNameUnderParent(layout: ViewLayoutPB.Grid);
@ -65,7 +65,7 @@ void main() {
testWidgets('delete field', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
await tester.createNewPageWithNameUnderParent(layout: ViewLayoutPB.Grid);
@ -85,7 +85,7 @@ void main() {
testWidgets('duplicate field', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
await tester.createNewPageWithNameUnderParent(layout: ViewLayoutPB.Grid);
@ -105,7 +105,7 @@ void main() {
testWidgets('insert field on either side of a field', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
await tester.createNewPageWithNameUnderParent(layout: ViewLayoutPB.Grid);
@ -128,7 +128,7 @@ void main() {
testWidgets('create checklist field', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
await tester.createNewPageWithNameUnderParent(layout: ViewLayoutPB.Grid);
@ -148,7 +148,7 @@ void main() {
testWidgets('create list of fields', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
await tester.createNewPageWithNameUnderParent(layout: ViewLayoutPB.Grid);
@ -180,7 +180,7 @@ void main() {
testWidgets('field types with empty type option editor', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
await tester.createNewPageWithNameUnderParent(layout: ViewLayoutPB.Grid);
@ -212,7 +212,7 @@ void main() {
testWidgets('number field type option', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
await tester.createNewPageWithNameUnderParent(layout: ViewLayoutPB.Grid);
await tester.scrollToRight(find.byType(GridPage));
@ -258,7 +258,7 @@ void main() {
testWidgets('add option', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
await tester.createNewPageWithNameUnderParent(
layout: ViewLayoutPB.Grid,
@ -286,7 +286,7 @@ void main() {
testWidgets('date time field type options', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
await tester.createNewPageWithNameUnderParent(layout: ViewLayoutPB.Grid);
await tester.scrollToRight(find.byType(GridPage));

View File

@ -14,7 +14,7 @@ void main() {
group('reminder in database', () {
testWidgets('add date field and add reminder', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
await tester.createNewPageWithNameUnderParent(layout: ViewLayoutPB.Grid);
@ -68,7 +68,7 @@ void main() {
testWidgets('navigate from reminder to open row', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
await tester.createNewPageWithNameUnderParent(layout: ViewLayoutPB.Grid);
@ -135,7 +135,7 @@ void main() {
'toggle include time sets reminder option correctly',
(tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
await tester.createNewPageWithNameUnderParent(
layout: ViewLayoutPB.Grid,

View File

@ -18,7 +18,7 @@ void main() {
group('grid row detail page:', () {
testWidgets('opens', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
// Create a new grid
await tester.createNewPageWithNameUnderParent(layout: ViewLayoutPB.Grid);
@ -35,7 +35,7 @@ void main() {
testWidgets('add emoji', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
// Create a new grid
await tester.createNewPageWithNameUnderParent(layout: ViewLayoutPB.Grid);
@ -54,7 +54,7 @@ void main() {
testWidgets('update emoji', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
// Create a new grid
await tester.createNewPageWithNameUnderParent(layout: ViewLayoutPB.Grid);
@ -81,7 +81,7 @@ void main() {
testWidgets('remove emoji', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
// Create a new grid
await tester.createNewPageWithNameUnderParent(layout: ViewLayoutPB.Grid);
@ -102,7 +102,7 @@ void main() {
testWidgets('create list of fields', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
// Create a new grid
await tester.createNewPageWithNameUnderParent(layout: ViewLayoutPB.Grid);
@ -136,7 +136,7 @@ void main() {
testWidgets('change order of fields and cells', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
// Create a new grid
await tester.createNewPageWithNameUnderParent(layout: ViewLayoutPB.Grid);
@ -169,7 +169,7 @@ void main() {
testWidgets('hide and show hidden fields', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
// Create a new grid
await tester.createNewPageWithNameUnderParent(layout: ViewLayoutPB.Grid);
@ -218,7 +218,7 @@ void main() {
testWidgets('update the contents of the document and re-open it',
(tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
// Create a new grid
await tester.createNewPageWithNameUnderParent(layout: ViewLayoutPB.Grid);
@ -258,7 +258,7 @@ void main() {
'check if the title wraps properly when a long text is inserted',
(tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
// Create a new grid
await tester.createNewPageWithNameUnderParent(layout: ViewLayoutPB.Grid);
@ -297,7 +297,7 @@ void main() {
testWidgets('delete row', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
// Create a new grid
await tester.createNewPageWithNameUnderParent(layout: ViewLayoutPB.Grid);
@ -314,7 +314,7 @@ void main() {
testWidgets('duplicate row', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
// Create a new grid
await tester.createNewPageWithNameUnderParent(layout: ViewLayoutPB.Grid);

View File

@ -11,7 +11,7 @@ void main() {
group('grid', () {
testWidgets('create row of the grid', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
await tester.createNewPageWithNameUnderParent(layout: ViewLayoutPB.Grid);
await tester.tapCreateRowButtonInGrid();
@ -23,7 +23,7 @@ void main() {
testWidgets('create row from row menu of the grid', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
await tester.createNewPageWithNameUnderParent(layout: ViewLayoutPB.Grid);
@ -38,7 +38,7 @@ void main() {
testWidgets('delete row of the grid', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
await tester.createNewPageWithNameUnderParent(layout: ViewLayoutPB.Grid);
await tester.hoverOnFirstRowOfGrid();
@ -55,7 +55,7 @@ void main() {
testWidgets('check number of row indicator in the initial grid',
(tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
await tester.createNewPageWithNameUnderParent(layout: ViewLayoutPB.Grid);

View File

@ -12,7 +12,7 @@ void main() {
group('grid', () {
testWidgets('update layout', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
await tester.createNewPageWithNameUnderParent(layout: ViewLayoutPB.Grid);
@ -29,7 +29,7 @@ void main() {
testWidgets('update layout multiple times', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
await tester.createNewPageWithNameUnderParent(layout: ViewLayoutPB.Grid);

View File

@ -12,7 +12,7 @@ void main() {
group('database', () {
testWidgets('create linked view', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
await tester.createNewPageWithNameUnderParent(layout: ViewLayoutPB.Grid);
@ -33,7 +33,7 @@ void main() {
testWidgets('rename and delete linked view', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
await tester.createNewPageWithNameUnderParent(layout: ViewLayoutPB.Grid);
@ -58,7 +58,7 @@ void main() {
testWidgets('delete the last database view', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
await tester.createNewPageWithNameUnderParent(layout: ViewLayoutPB.Grid);

View File

@ -14,7 +14,7 @@ void main() {
group('document alignment', () {
testWidgets('edit alignment in toolbar', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
final selection = Selection.single(
path: [0],
@ -48,7 +48,7 @@ void main() {
testWidgets('edit alignment using shortcut', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
// click the first line of the readme
await tester.editor.tapLineOfEditorAt(0);

View File

@ -15,7 +15,7 @@ void main() {
group('paste in codeblock', () {
testWidgets('paste multiple lines in codeblock', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
// create a new document
await tester.createNewPageWithNameUnderParent();

View File

@ -304,7 +304,7 @@ extension on WidgetTester {
(String, Uint8List?)? image,
}) async {
await initializeAppFlowy();
await tapGoButton();
await tapAnonymousSignInButton();
// create a new document
await createNewPageWithNameUnderParent();

View File

@ -14,7 +14,7 @@ void main() {
(tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
// create a new document
await tester.createNewPageWithNameUnderParent();
@ -30,7 +30,7 @@ void main() {
testWidgets('delete the readme page and restore it', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
// delete the readme page
await tester.hoverOnPageName(
@ -54,7 +54,7 @@ void main() {
(tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
// delete the readme page
await tester.hoverOnPageName(

View File

@ -15,7 +15,7 @@ void main() {
group('insert inline document reference', () {
testWidgets('insert by slash menu', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
final name = await createDocumentToReference(tester);
@ -42,7 +42,7 @@ void main() {
testWidgets('insert by `[[` character shortcut', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
final name = await createDocumentToReference(tester);
@ -62,7 +62,7 @@ void main() {
testWidgets('insert by `+` character shortcut', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
final name = await createDocumentToReference(tester);

View File

@ -12,7 +12,7 @@ void main() {
'click + to add a block after current selection, and click + and option key to add a block before current selection',
(tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
var editorState = tester.editor.getCurrentEditorState();
expect(editorState.getNodeAtPath([1])?.delta?.toPlainText(), isNotEmpty);

View File

@ -13,7 +13,7 @@ void main() {
(tester) async {
// combine the two tests into one to avoid the time-consuming process of initializing the app
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
final selection = Selection.single(
path: [0],

View File

@ -16,7 +16,7 @@ void main() {
group('cover image', () {
testWidgets('document cover tests', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
tester.expectToSeeNoDocumentCover();
@ -53,7 +53,7 @@ void main() {
testWidgets('document icon tests', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
tester.expectToSeeDocumentIcon('⭐️');
@ -86,7 +86,7 @@ void main() {
testWidgets('icon and cover at the same time', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
tester.expectToSeeDocumentIcon('⭐️');
tester.expectToSeeNoDocumentCover();
@ -110,7 +110,7 @@ void main() {
testWidgets('shuffle icon', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
await tester.editor.tapGettingStartedIcon();
@ -123,7 +123,7 @@ void main() {
testWidgets('change skin tone', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
await tester.editor.tapGettingStartedIcon();

View File

@ -20,7 +20,7 @@ void main() {
group('database view in document', () {
testWidgets('insert a referenced grid', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
await insertReferenceDatabase(tester, ViewLayoutPB.Grid);
@ -48,7 +48,7 @@ void main() {
testWidgets('insert a referenced board', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
await insertReferenceDatabase(tester, ViewLayoutPB.Board);
@ -64,7 +64,7 @@ void main() {
testWidgets('insert a referenced calendar', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
await insertReferenceDatabase(tester, ViewLayoutPB.Calendar);
@ -80,7 +80,7 @@ void main() {
testWidgets('create a grid inside a document', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
await createInlineDatabase(tester, ViewLayoutPB.Grid);
@ -96,7 +96,7 @@ void main() {
testWidgets('create a board inside a document', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
await createInlineDatabase(tester, ViewLayoutPB.Board);
@ -112,7 +112,7 @@ void main() {
testWidgets('create a calendar inside a document', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
await createInlineDatabase(tester, ViewLayoutPB.Calendar);

View File

@ -32,7 +32,7 @@ void main() {
group('image block in document', () {
testWidgets('insert an image from local file', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
// create a new document
await tester.createNewPageWithNameUnderParent(
@ -80,7 +80,7 @@ void main() {
testWidgets('insert an image from network', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
// create a new document
await tester.createNewPageWithNameUnderParent(
@ -133,7 +133,7 @@ void main() {
testWidgets('insert an image from unsplash', (tester) async {
await runWithNetworkImages(() async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
// create a new document
await tester.createNewPageWithNameUnderParent(

View File

@ -16,7 +16,7 @@ void main() {
group('inline math equation in document', () {
testWidgets('insert an inline math equation', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
// create a new document
await tester.createNewPageWithNameUnderParent(
@ -61,7 +61,7 @@ void main() {
testWidgets('remove the inline math equation format', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
// create a new document
await tester.createNewPageWithNameUnderParent(

View File

@ -13,7 +13,7 @@ void main() {
group('inline page view in document', () {
testWidgets('insert a inline page - grid', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
await insertInlinePage(tester, ViewLayoutPB.Grid);
@ -24,7 +24,7 @@ void main() {
testWidgets('insert a inline page - board', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
await insertInlinePage(tester, ViewLayoutPB.Board);
@ -35,7 +35,7 @@ void main() {
testWidgets('insert a inline page - calendar', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
await insertInlinePage(tester, ViewLayoutPB.Calendar);
@ -46,7 +46,7 @@ void main() {
testWidgets('insert a inline page - document', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
await insertInlinePage(tester, ViewLayoutPB.Document);
@ -57,7 +57,7 @@ void main() {
testWidgets('insert a inline page and rename it', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
final pageName = await insertInlinePage(tester, ViewLayoutPB.Document);
@ -76,7 +76,7 @@ void main() {
testWidgets('insert a inline page and delete it', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
final pageName = await insertInlinePage(tester, ViewLayoutPB.Grid);

View File

@ -20,7 +20,7 @@ void main() {
testWidgets('insert/edit/open link', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
// create a new document
await tester.createNewPageWithNameUnderParent();

View File

@ -19,7 +19,7 @@ void main() {
group('outline block test', () {
testWidgets('insert an outline block', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
await tester.createNewPageWithNameUnderParent(
name: 'outline_test',
@ -35,7 +35,7 @@ void main() {
testWidgets('insert an outline block and check if headings are visible',
(tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
await tester.createNewPageWithNameUnderParent(
name: 'outline_test',
@ -91,7 +91,7 @@ void main() {
testWidgets("control the depth of outline block", (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
await tester.createNewPageWithNameUnderParent(
name: 'outline_test',

View File

@ -36,7 +36,7 @@ void main() {
testWidgets('convert > to toggle list, and click the icon to close it',
(tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
// create a new document
await tester.createNewPageWithNameUnderParent();
@ -80,7 +80,7 @@ void main() {
(tester) async {
// if the toggle list is closed, press enter key will insert a new toggle list after it
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
// create a new document
await tester.createNewPageWithNameUnderParent();
@ -117,7 +117,7 @@ void main() {
testWidgets('press enter key when the toggle list is open', (tester) async {
// if the toggle list is open, press enter key will insert a new paragraph inside it
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
// create a new document
await tester.createNewPageWithNameUnderParent();
@ -152,7 +152,7 @@ void main() {
testWidgets('clear the format if toggle list if empty', (tester) async {
// if the toggle list is open, press enter key will insert a new paragraph inside it
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
// create a new document
await tester.createNewPageWithNameUnderParent();
@ -181,7 +181,7 @@ void main() {
(tester) async {
// if the toggle list is open, press enter key will insert a new paragraph inside it
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
// create a new document
await tester.createNewPageWithNameUnderParent();

View File

@ -13,7 +13,7 @@ void main() {
group('edit document', () {
testWidgets('redo & undo', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
// create a new document called Sample
const pageName = 'Sample';
@ -67,7 +67,7 @@ void main() {
testWidgets('write a readme document', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
// create a new document called Sample
const pageName = 'Sample';

View File

@ -13,7 +13,7 @@ void main() {
group('Grid Calculations', () {
testWidgets('add calculation and update cell', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
await tester.createNewPageWithNameUnderParent(layout: ViewLayoutPB.Grid);
@ -47,7 +47,7 @@ void main() {
testWidgets('add calculations and remove row', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
await tester.createNewPageWithNameUnderParent(layout: ViewLayoutPB.Grid);

View File

@ -27,7 +27,7 @@ void main() {
const time = "23:59";
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
final dateTimeSettings =
await UserSettingsBackendService().getDateTimeSettings();
@ -76,7 +76,7 @@ void main() {
testWidgets('Add reminder for tomorrow, and navigate to it',
(tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
await tester.editor.tapLineOfEditorAt(0);
await tester.editor.getCurrentEditorState().insertNewLine();

View File

@ -11,7 +11,7 @@ void main() {
group('board add row test', () {
testWidgets('Add card from header', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
await tester.openSettings();
await tester.openSettingsPage(SettingsPage.notifications);

View File

@ -14,7 +14,7 @@ void main() {
testWidgets('select language, language changed', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
await tester.expectToSeeHomePageWithGetStartedPage();
await tester.openSettings();

View File

@ -15,7 +15,7 @@ void main() {
group('Rename current view item', () {
testWidgets('by F2 shortcut', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
await FlowyTestKeyboard.simulateKeyDownEvent(
[LogicalKeyboardKey.f2],

View File

@ -27,7 +27,7 @@ void main() {
testWidgets('first time the personal folder is expanded', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
// first time is expanded
expect(isExpanded(type: FolderCategoryType.private), true);

View File

@ -18,7 +18,7 @@ void main() {
'Toggle favorites for views creates / removes the favorite header along with favorite views',
(tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
// no favorite folder
expect(find.byType(FavoriteFolder), findsNothing);
@ -74,7 +74,7 @@ void main() {
'renaming a favorite view updates name under favorite header',
(tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
const name = 'test';
await tester.favoriteViewByName(gettingStarted);
@ -100,7 +100,7 @@ void main() {
'deleting first level favorite view removes its instance from favorite header, deleting root level views leads to removal of all favorites that are its children',
(tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
final names = [1, 2].map((e) => 'document_$e').toList();
for (var i = 0; i < names.length; i++) {
@ -157,7 +157,7 @@ void main() {
'view selection is synced between favorites and personal folder',
(tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
await tester.createNewPageWithNameUnderParent();
await tester.favoriteViewByName(gettingStarted);
@ -177,7 +177,7 @@ void main() {
'context menu opens up for favorites',
(tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
await tester.createNewPageWithNameUnderParent();
await tester.favoriteViewByName(gettingStarted);

View File

@ -14,7 +14,7 @@ void main() {
group('Icon', () {
testWidgets('Update page icon in sidebar', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
// create document, board, grid and calendar views
for (final value in ViewLayoutPB.values) {
@ -42,7 +42,7 @@ void main() {
testWidgets('Update page icon in title bar', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
// create document, board, grid and calendar views
for (final value in ViewLayoutPB.values) {

View File

@ -20,7 +20,7 @@ void main() {
group('sidebar test', () {
testWidgets('create a new page', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
// create a new page
await tester.tapNewPageButton();
@ -36,7 +36,7 @@ void main() {
testWidgets('create a new document, grid, board and calendar',
(tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
for (final layout in ViewLayoutPB.values) {
// create a new page
@ -74,7 +74,7 @@ void main() {
testWidgets('create some nested pages, and move them', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
final names = [1, 2, 3, 4].map((e) => 'document_$e').toList();
for (var i = 0; i < names.length; i++) {
@ -140,7 +140,7 @@ void main() {
testWidgets('unable to move a document into a database', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
const document = 'document';
await tester.createNewPageWithNameUnderParent(
@ -183,7 +183,7 @@ void main() {
testWidgets('unable to create a new database inside the existing one',
(tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
const grid = 'grid';
await tester.createNewPageWithNameUnderParent(

View File

@ -15,7 +15,7 @@ void main() {
(tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
await tester.expectToSeeHomePageWithGetStartedPage();
await tester.openSettings();
@ -47,7 +47,7 @@ void main() {
testWidgets('reset the font family', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
await tester.expectToSeeHomePageWithGetStartedPage();
await tester.openSettings();

View File

@ -17,7 +17,7 @@ void main() {
testWidgets('cmd/ctrl+alt+e shortcut opens the emoji picker',
(tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
final Finder editor = find.byType(AppFlowyEditor);
await tester.tap(editor);

View File

@ -10,7 +10,7 @@ void main() {
group('Empty', () {
testWidgets('toggle theme mode', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
});
});
}

View File

@ -19,7 +19,7 @@ void main() {
testWidgets('toggle theme mode', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
await tester.expectToSeeHomePageWithGetStartedPage();
await tester.openSettings();
@ -71,7 +71,7 @@ void main() {
testWidgets('show or hide home menu', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
await tester.expectToSeeHomePageWithGetStartedPage();
await tester.pumpAndSettle();

View File

@ -15,7 +15,7 @@ void main() {
group('import files', () {
testWidgets('import multiple markdown files', (tester) async {
final context = await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
// expect to see a getting started page
tester.expectToSeePageName(gettingStarted);
@ -48,7 +48,7 @@ void main() {
testWidgets('import markdown file with table', (tester) async {
final context = await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
// expect to see a getting started page
tester.expectToSeePageName(gettingStarted);
@ -77,12 +77,18 @@ void main() {
await tester.openPage('markdown_with_table');
final importedPageEditorState = tester.editor.getCurrentEditorState();
expect(importedPageEditorState.getNodeAtPath([0])!.type,
HeadingBlockKeys.type,);
expect(importedPageEditorState.getNodeAtPath([2])!.type,
HeadingBlockKeys.type,);
expect(importedPageEditorState.getNodeAtPath([4])!.type,
TableBlockKeys.type,);
expect(
importedPageEditorState.getNodeAtPath([0])!.type,
HeadingBlockKeys.type,
);
expect(
importedPageEditorState.getNodeAtPath([2])!.type,
HeadingBlockKeys.type,
);
expect(
importedPageEditorState.getNodeAtPath([4])!.type,
TableBlockKeys.type,
);
});
});
}

View File

@ -14,7 +14,7 @@ void main() {
group('share markdown in document page', () {
testWidgets('click the share button in document page', (tester) async {
final context = await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
// mock the file picker
final path = await mockSaveFilePath(
@ -38,7 +38,7 @@ void main() {
'share the markdown after renaming the document name',
(tester) async {
final context = await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
// expect to see a getting started page
tester.expectToSeePageName(gettingStarted);
@ -104,12 +104,12 @@ fn main() {
> Click `?` at the bottom right for help and support.
> 🥰
>
>
> Like AppFlowy? Follow us:
> [GitHub](https://github.com/AppFlowy-IO/AppFlowy)
> [Twitter](https://twitter.com/appflowy): @appflowy
> [Newsletter](https://blog-appflowy.ghost.io/)
>
>

View File

@ -94,7 +94,7 @@ void main() {
testWidgets('reset to default location', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
// home and readme document
await tester.expectToSeeHomePageWithGetStartedPage();

View File

@ -22,7 +22,7 @@ void main() {
group('Tabs', () {
testWidgets('Open AppFlowy and open/navigate/close tabs', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.tapAnonymousSignInButton();
expect(
find.descendant(

View File

@ -118,7 +118,7 @@ extension AppFlowyTestBase on WidgetTester {
Future<void> waitUntilSignInPageShow() async {
if (isAuthEnabled) {
final finder = find.byType(SignInAnonymousButton);
final finder = find.byType(SignInAnonymousButtonV2);
await pumpUntilFound(finder, timeout: const Duration(seconds: 30));
expect(finder, findsOneWidget);
} else {

View File

@ -36,14 +36,14 @@ import 'util.dart';
extension CommonOperations on WidgetTester {
/// Tap the GetStart button on the launch page.
Future<void> tapGoButton() async {
Future<void> tapAnonymousSignInButton() async {
// local version
final goButton = find.byType(GoButton);
if (goButton.evaluate().isNotEmpty) {
await tapButton(goButton);
} else {
// cloud version
final anonymousButton = find.byType(SignInAnonymousButton);
final anonymousButton = find.byType(SignInAnonymousButtonV2);
await tapButton(anonymousButton);
}

View File

@ -98,7 +98,7 @@ import 'mock/mock_file_picker.dart';
extension AppFlowyDatabaseTest on WidgetTester {
Future<void> openV020database() async {
final context = await initializeAppFlowy();
await tapGoButton();
await tapAnonymousSignInButton();
// expect to see a readme page
expectToSeePageName(gettingStarted);