This repository has been archived by the owner on Jan 25, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #634 from Parabeac/release/2.8.0
Release/2.8.0
- Loading branch information
Showing
61 changed files
with
5,594 additions
and
19 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
import 'dart:io'; | ||
import 'package:path/path.dart' as path; | ||
import 'package:test/test.dart'; | ||
|
||
void main() { | ||
final projectName = 'golden_auto_layout_testing_project'; | ||
final basePath = path.join(path.current, 'test', 'golden'); | ||
final runtimeFilePath = path.join(basePath, projectName, 'lib'); | ||
final goldenFilesPath = path.join(basePath, 'golden_files', 'auto_layout'); | ||
group('Auto Layout Golden Test', () { | ||
setUp(() async { | ||
// Run Parabeac core to generate test file | ||
await Process.run('dart', [ | ||
'parabeac.dart', | ||
'-f', | ||
'9yfEiTTiE5hoyZeRTGopQd', | ||
'-k', | ||
'346172-e6b93eec-364f-4baa-bee8-24bf1e4d26da', | ||
'-n', | ||
'$projectName', | ||
'-o', | ||
'$basePath' | ||
]); | ||
}); | ||
test('Generating Auto Layout and Comparing Golden File', () async { | ||
/// Fetch a list with all the names for Auto Layout Golden Files | ||
final fileNames = | ||
File(path.join(goldenFilesPath, 'auto_layout_file_names.txt')); | ||
|
||
final goldenFiles = <File>[]; | ||
final runtimeFiles = <File>[]; | ||
|
||
var fileNamesLines = fileNames.readAsLinesSync(); | ||
|
||
/// Add all files as golden files to the list | ||
/// Also add run time files to another list | ||
for (var i = 0; i < fileNamesLines.length; i++) { | ||
goldenFiles.add( | ||
File(path.join(goldenFilesPath, '${fileNamesLines[i]}.golden'))); | ||
|
||
runtimeFiles.add(File(path.join(runtimeFilePath, 'screens', | ||
'auto_layout_permutations', '${fileNamesLines[i]}.g.dart'))); | ||
} | ||
|
||
/// Iterate through golden/runtime files and compare them | ||
for (var i = 0; i < goldenFiles.length; i++) { | ||
var goldenFile = goldenFiles[i]; | ||
var runtimeFile = runtimeFiles[i]; | ||
var goldenFileLines = goldenFile.readAsLinesSync(); | ||
var runtimeFileLines = runtimeFile.readAsLinesSync(); | ||
|
||
for (var j = 0; j < goldenFileLines.length; j++) { | ||
expect(runtimeFileLines[j], goldenFileLines[j], | ||
reason: 'File ${path.basename(goldenFile.path)} Line $j'); | ||
} | ||
} | ||
}, timeout: Timeout(Duration(minutes: 5))); | ||
|
||
tearDown(() async { | ||
// Remove temporary project | ||
await Process.start('rm', ['-rf', path.join(basePath, projectName)]); | ||
}); | ||
}); | ||
} |
50 changes: 50 additions & 0 deletions
50
test/golden/golden_files/auto_layout/auto_layout_file_names.txt
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,50 @@ | ||
col_hz_fx_vr_fx_sp_pk1 | ||
col_hz_fx_vr_fx_sp_pk2 | ||
col_hz_fx_vr_fx_sp_pk3 | ||
col_hz_fx_vr_fx_sp_pk4 | ||
col_hz_fx_vr_fx_sp_pk5 | ||
col_hz_fx_vr_fx_sp_pk6 | ||
col_hz_fx_vr_fx_sp_pk7 | ||
col_hz_fx_vr_fx_sp_pk8 | ||
col_hz_fx_vr_fx_sp_pk9 | ||
col_hz_fx_vr_fx_sp_sb147 | ||
col_hz_fx_vr_fx_sp_sb258 | ||
col_hz_fx_vr_fx_sp_sb369 | ||
col_hz_fx_vr_hg_sp_pk147 | ||
col_hz_fx_vr_hg_sp_pk258 | ||
col_hz_fx_vr_hg_sp_pk369 | ||
col_hz_hg_vr_fx_sp_pk1 | ||
col_hz_hg_vr_fx_sp_pk2 | ||
col_hz_hg_vr_fx_sp_pk3 | ||
col_hz_hg_vr_fx_sp_pk4 | ||
col_hz_hg_vr_fx_sp_pk5 | ||
col_hz_hg_vr_fx_sp_pk6 | ||
col_hz_hg_vr_fx_sp_pk7 | ||
col_hz_hg_vr_fx_sp_pk8 | ||
col_hz_hg_vr_fx_sp_pk9 | ||
col_hz_hg_vr_fx_sp_sb147 | ||
col_hz_hg_vr_fx_sp_sb258 | ||
col_hz_hg_vr_fx_sp_sb369 | ||
col_hz_hg_vr_hg_sp_pk123456789 | ||
no_space_col_hz_hg_vr_hg_sp_pk123456789 | ||
no_space_row_hz_hg_vr_hg_sp_pk123456789 | ||
row_hz_fx_vr_fx_sp_pk1 | ||
row_hz_fx_vr_fx_sp_pk2 | ||
row_hz_fx_vr_fx_sp_pk3 | ||
row_hz_fx_vr_fx_sp_pk4 | ||
row_hz_fx_vr_fx_sp_pk5 | ||
row_hz_fx_vr_fx_sp_pk6 | ||
row_hz_fx_vr_fx_sp_pk7 | ||
row_hz_fx_vr_fx_sp_pk8 | ||
row_hz_fx_vr_fx_sp_pk9 | ||
row_hz_fx_vr_fx_sp_sb123 | ||
row_hz_fx_vr_fx_sp_sb456 | ||
row_hz_fx_vr_fx_sp_sb789 | ||
row_hz_fx_vr_hg_sp_pk147 | ||
row_hz_fx_vr_hg_sp_pk258 | ||
row_hz_fx_vr_hg_sp_pk369 | ||
row_hz_fx_vr_hg_sp_sb123456789 | ||
row_hz_hg_vr_fx_sp_pk147 | ||
row_hz_hg_vr_fx_sp_pk258 | ||
row_hz_hg_vr_fx_sp_pk369 | ||
row_hz_hg_vr_hg_sp_pk123456789 |
110 changes: 110 additions & 0 deletions
110
test/golden/golden_files/auto_layout/col_hz_fx_vr_fx_sp_pk1.golden
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,110 @@ | ||
// ********************************************************************************* | ||
// PARABEAC-GENERATED CODE. DO NOT MODIFY. | ||
// | ||
// FOR MORE INFORMATION ON HOW TO USE PARABEAC, PLEASE VISIT docs.parabeac.com | ||
// ********************************************************************************* | ||
|
||
import 'package:flutter/material.dart'; | ||
import 'package:auto_size_text/auto_size_text.dart'; | ||
|
||
class ColHzFxVrFxSpPk1 extends StatefulWidget { | ||
const ColHzFxVrFxSpPk1({ | ||
Key? key, | ||
}) : super(key: key); | ||
@override | ||
_ColHzFxVrFxSpPk1 createState() => _ColHzFxVrFxSpPk1(); | ||
} | ||
|
||
class _ColHzFxVrFxSpPk1 extends State<ColHzFxVrFxSpPk1> { | ||
_ColHzFxVrFxSpPk1(); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Material( | ||
color: Colors.white, | ||
child: Stack(children: [ | ||
Positioned( | ||
left: 37.0, | ||
width: 326.0, | ||
top: 100.0, | ||
height: 200.0, | ||
child: Container( | ||
padding: EdgeInsets.only( | ||
left: 10.0, | ||
right: 10.0, | ||
top: 10.0, | ||
bottom: 10.0, | ||
), | ||
width: 326.000, | ||
child: Column( | ||
mainAxisAlignment: MainAxisAlignment.start, | ||
crossAxisAlignment: CrossAxisAlignment.start, | ||
children: [ | ||
Container( | ||
height: 15.0, | ||
width: 24.0, | ||
child: Container( | ||
width: 24.000, | ||
height: 15.000, | ||
child: AutoSizeText( | ||
'Left', | ||
style: TextStyle( | ||
fontFamily: 'Sanchez', | ||
fontSize: 12.0, | ||
fontWeight: FontWeight.w400, | ||
letterSpacing: 0.0, | ||
color: Colors.white, | ||
), | ||
textAlign: TextAlign.left, | ||
))), | ||
SizedBox( | ||
height: 10.0, | ||
), | ||
Container( | ||
height: 15.0, | ||
width: 39.0, | ||
child: Container( | ||
width: 39.000, | ||
height: 15.000, | ||
child: AutoSizeText( | ||
'Middle', | ||
style: TextStyle( | ||
fontFamily: 'Sanchez', | ||
fontSize: 12.0, | ||
fontWeight: FontWeight.w400, | ||
letterSpacing: 0.0, | ||
color: Colors.white, | ||
), | ||
textAlign: TextAlign.left, | ||
))), | ||
SizedBox( | ||
height: 10.0, | ||
), | ||
Container( | ||
height: 15.0, | ||
width: 31.0, | ||
child: Container( | ||
width: 31.000, | ||
height: 15.000, | ||
child: AutoSizeText( | ||
'Right', | ||
style: TextStyle( | ||
fontFamily: 'Sanchez', | ||
fontSize: 12.0, | ||
fontWeight: FontWeight.w400, | ||
letterSpacing: 0.0, | ||
color: Colors.white, | ||
), | ||
textAlign: TextAlign.left, | ||
))), | ||
])), | ||
), | ||
]), | ||
); | ||
} | ||
|
||
@override | ||
void dispose() { | ||
super.dispose(); | ||
} | ||
} |
Oops, something went wrong.