Skip to content

Commit

Permalink
feat: initialize flutter usercentric finder, #1
Browse files Browse the repository at this point in the history
  • Loading branch information
luifr10 committed Mar 5, 2024
1 parent 83cb50f commit 4338424
Show file tree
Hide file tree
Showing 19 changed files with 7,605 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: bug
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: enhancement
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
64 changes: 64 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: 'CI'

on:
push:
branches: [ "main"]
pull_request:
branches: [ "main" ]

env:
NODE_VERSION: 18.14.0
FLUTTER_VERSION: '3.16.9'

jobs:
analyse:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
flutter-version: $FLUTTER_VERSION
channel: 'stable'
- run: flutter analyse

test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
flutter-version: $FLUTTER_VERSION
channel: 'stable'
- run: flutter test

release:
if: github.ref == 'refs/heads/main'
needs: [ analyse, test ]
runs-on: ubuntu-latest
environment: release
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GH_TOKEN }}
- name: Use Node.js ${{env.NODE_VERSION}}
uses: actions/setup-node@v4
with:
node-version: ${{env.NODE_VERSION}}
registry-url: 'https://registry.npmjs.org'
- name: Build new release
run: npx semantic-release
shell: bash

publish:
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
needs: [ release ]
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
flutter-version: $FLUTTER_VERSION
channel: 'stable'
- name: Publish on pub.dev
run: dart publish
shell: bash
30 changes: 30 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.atom/
.buildlog/
.history
.svn/
migrate_working_dir/

# IntelliJ related
*.iml
*.ipr
*.iws
.idea/

# The .vscode folder contains launch configuration and tasks you configure in
# VS Code which you may wish to be included in version control, so this line
# is commented out by default.
#.vscode/

# Flutter/Dart/Pub related
# Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock.
/pubspec.lock
**/doc/api/
.dart_tool/
build/
node_modules/
10 changes: 10 additions & 0 deletions .metadata
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
# This file should be version controlled and should not be manually edited.

version:
revision: "2e9cb0aa71a386a91f73f7088d115c0d96654829"
channel: "stable"

project_type: package
36 changes: 36 additions & 0 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
[
"semantic-release-replace-plugin",
{
"replacements": [
{
"files": [
"pubspec.yaml"
],
"from": "version: .*",
"to": "version: ${nextRelease.version}",
"results": [
{
"file": "pubspec.yaml",
"hasChanged": true,
"numMatches": 1,
"numReplacements": 1
}
],
"countMatches": true
}
]
}
],
["@semantic-release/git", {
"assets": [
"pubspec.yaml",
"CHANGELOG.md"
],
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}]
]
}
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
## 0.0.1-beta.1

* fix pub points

## 0.0.1-beta

* Initialisation
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# FLUTTER_FINDER_USERCENTRIC
Flutter finder to find element based on their semantic role(button, textfield, etc) and semantic label

## How to use it ?
```dart
testWidgets('byAccessibleName should return element when tooltip found', (tester) async {
await tester.pumpWidget(TestApp());
var finderByAccessibleName = find.byAccessibleName("ElevatedButtonWithTooltip");
expect(finderByAccessibleName, findsOneWidget);
expect((tester.widget(finderByAccessibleName) as Tooltip).message, "ElevatedButtonWithTooltip");
});
testWidgets('byAccessibleRoleAndName should return ElevatedButton when found', (tester) async {
await tester.pumpWidget(TestApp());
var finderByAccessibleRoleAndName = find.byAccessibleRoleAndName(tester, AccessibleRole.button, "SimpleElevatedButtonText");
expect(finderByAccessibleRoleAndName, findsOneWidget);
});
```

For more example [there](./packages/flutter-finder-usercentric/test/test_app.dart).
4 changes: 4 additions & 0 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
include: package:flutter_lints/flutter.yaml

# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options

0 comments on commit 4338424

Please sign in to comment.