Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
bevzaanton committed Feb 15, 2021
2 parents f3a3ddd + 675173f commit 9a81c1b
Show file tree
Hide file tree
Showing 10 changed files with 363 additions and 80 deletions.
25 changes: 14 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Stfalcon Fixturer

Utility for developers and QAs what helps minimize time wasting on writing the same data for testing over and over again.
A Utility for developers and QAs which helps minimize time wasting on writing the same data for testing over and over again.
You can write fixture in XML one time and use it for build testing. The library can autofill EditText with your fixture data.

### Who we are
Need iOS and Android apps, MVP development or prototyping? Contact us via [email protected]. We develop software since 2009, and we're known experts in this field. Check out our [portfolio](https://stfalcon.com/en/portfolio) and see more libraries from [stfalcon-studio](https://stfalcon-studio.github.io/).
Need iOS and Android apps, MVP development or prototyping? Contact us via [email protected]. We develop software since 2009, and we're known experts in this field. Check out our [portfolio](https://stfalcon.com/en/portfolio) and see more libraries from [stfalcon-studio](https://stfalcon.com/en/opensource).

### Download

Expand All @@ -15,8 +15,8 @@ compile 'com.github.stfalcon:stfalcon-fixturer:0.1.0'

### Usage

Create xml file in raw directory of app resources.
Example:
Create xml file in raw directory of app resources.
Example:
```xml
<?xml version="1.0" encoding="utf-8"?>
<fixtures>
Expand All @@ -42,7 +42,7 @@ Example:
</fixture>
</fixtures>
```
All `fixture` require `tag` attribute. This tag will be used for binding input fields to fixture.
All `fixture` require `tag` attribute. This tag will be used for binding input fields to fixture.
Also you can put some fixtures in groups. For example `email` and `password` can be marked as group `account`. This two fixtures must have the same item count. And in this case where we will select one fixture from group, it will automatically put data to all bound EditTexts to the same grouped fixtures.

To initialize library you have to add this line to your Application `onCreate` method:
Expand All @@ -55,12 +55,13 @@ class SampleApplication : Application() {
}
}
```
First parameter it's your Application context.
First parameter it's your Application context.
Second - resource ID of you fixtures XML file.
The default behaviour is Fixturer works only for debug builds. But if you want to change this behaviour you can pass Boolean flag as third parameter.
The default behavior is Fixturer works only for debug builds. But if you want to change this behavior you can pass Boolean flag as third parameter.

After that you can bind your EditTexts to the fixtures in your activity(fragment) classes.
Kotlin:

Kotlin:
```kotlin
loginEmailEt.setFixtureTag("email")
```
Expand All @@ -72,11 +73,13 @@ Where `loginEmailEt` is EditText and "email" is tag of the fixture.

Run your application and look on magic :) You can call fixtures dialog by triple tap on bound to fixture EditText.

![alt tag](https://i.imgur.com/KoeGW7E.gif)
![](https://i.imgur.com/zrdQYM2.gif)

![](https://i.imgur.com/cl6FDA6.gif)

Take a look at the [sample project](sample) for more information

### License
### License

```
Copyright 2018 stfalcon.com
Expand All @@ -94,4 +97,4 @@ See the License for the specific language governing permissions and
limitations under the License.
```

[sample]: <https://github.com/stfalcon-studio/StfalconFixturer-android/tree/master/sample>
[sample]: <https://github.com/stfalcon-studio/StfalconFixturer-android/tree/master/sample>
30 changes: 16 additions & 14 deletions sample/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.stfalcon.stfalconfixturer.sample">
package="com.stfalcon.stfalconfixturer.sample">

<application
android:name="com.stfalcon.stfalconfixturer.sample.SampleApplication"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name="com.stfalcon.stfalconfixturer.sample.LoginActivity">
android:name="com.stfalcon.stfalconfixturer.sample.SampleApplication"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity
android:name="com.stfalcon.stfalconfixturer.sample.LoginActivity"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>

<category android:name="android.intent.category.LAUNCHER"/>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.stfalcon.stfalconfixturer.sample.InfoActivity">
</activity>
<activity
android:name="com.stfalcon.stfalconfixturer.sample.InfoActivity"
android:screenOrientation="portrait"></activity>
</application>

</manifest>
12 changes: 12 additions & 0 deletions sample/src/main/res/drawable/btn_rounded.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="@color/cornflower_blue" />
<corners android:radius="12dp" />

<gradient
android:angle="90"
android:endColor="@color/soft_blue"
android:startColor="@color/cornflower_blue_two"
android:type="linear" />
</shape>
27 changes: 27 additions & 0 deletions sample/src/main/res/drawable/circle.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?><!--
~ Copyright (c) 2018. Stepan Tanasiychuk
~
~ This file is part of $filename is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Found ation, either version 3 of the License, or
~ (at your option) any later version.
~
~ This program is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<gradient
android:angle="90"
android:endColor="@color/soft_blue_dark"
android:startColor="@color/soft_blue"
android:type="linear" />
<size
android:width="300dp"
android:height="300dp" />
</shape>
45 changes: 45 additions & 0 deletions sample/src/main/res/drawable/circles.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (c) 2018. Stepan Tanasiychuk
~
~ This file is part of $filename is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Found ation, either version 3 of the License, or
~ (at your option) any later version.
~
~ This program is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
-->

<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Larger blue circle in back -->
<item>
<shape android:shape="oval">
<gradient
android:angle="90"
android:endColor="@color/soft_blue_dark"
android:startColor="@color/soft_blue"
android:type="linear" />
<size
android:width="300dp"
android:height="300dp"/>
</shape>
</item>
<!-- Smaller red circle in front -->
<item>
<shape android:shape="oval">
<!-- transparent stroke = larger_circle_size - smaller_circle_size -->
<stroke android:color="@android:color/transparent"
android:width="100dp"/>
<solid android:color="@color/white"/>
<size
android:width="200dp"
android:height="200dp"/>
</shape>
</item>
</layer-list>
91 changes: 66 additions & 25 deletions sample/src/main/res/layout/activity_info.xml
Original file line number Diff line number Diff line change
@@ -1,38 +1,79 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".InfoActivity">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="16dp"
tools:context=".InfoActivity">
android:layout_height="wrap_content"
android:orientation="vertical">

<android.support.design.widget.TextInputLayout
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/name">
android:layout_height="200dp"
android:layout_margin="16dp">

<EditText
android:id="@+id/secondNameEt"
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
/>
android:layout_height="match_parent"
android:layout_margin="16dp"
android:gravity="center"
android:orientation="vertical">

<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/name">

<EditText
android:id="@+id/secondNameEt"
android:layout_width="match_parent"
android:layout_height="wrap_content" />

</android.support.design.widget.TextInputLayout>

<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/address">

<EditText
android:id="@+id/secondAddressEt"
android:layout_width="match_parent"
android:layout_height="wrap_content" />

</android.support.design.widget.TextInputLayout>
</android.support.design.widget.TextInputLayout>

<android.support.design.widget.TextInputLayout
</LinearLayout>

</android.support.v7.widget.CardView>

<!--For demo-->

<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/address">
android:layout_height="200dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginBottom="16dp" />

<EditText
android:id="@+id/secondAddressEt"
android:layout_width="match_parent"
android:layout_height="wrap_content"
/>
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="200dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginBottom="16dp" />

</android.support.design.widget.TextInputLayout>
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="200dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginBottom="16dp" />

</LinearLayout>

</LinearLayout>
</ScrollView>
Loading

0 comments on commit 9a81c1b

Please sign in to comment.