This repository has been archived by the owner on Nov 18, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 79
Upgrade to spoon2.0.0-snapshot, android3.0.0 and gradle 4.1 #161
Closed
dweebo
wants to merge
15
commits into
stanfy:master
from
dweebo:spoon2.0.0-SNAPSHOT-android3.0.0-beta7
Closed
Changes from 13 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
a44c1ec
Upgrade to spoon 2.0.0-SNAPSHOT and build tools 3.0.0-beta7
CAH-peterhewitt a85a0f3
Promote to 2.0.0 snapshot
CAH-peterhewitt fa888e9
use correct android build tools on travis
CAH-peterhewitt 2511fa5
Add maven snapshot repo for spoon 2.0.0 snapshot
CAH-peterhewitt c29ad72
revert travis config and upgrade android build tools to 3.0.0
CAH-peterhewitt 83ffe58
Update the example project to use new updated spoon gradle plugin and…
CAH-peterhewitt 2d123e8
update to build tools 26.0.2 for travis
CAH-peterhewitt f006a5a
wip list android targets
CAH-peterhewitt 5c31883
try with a android-24 avd
CAH-peterhewitt def00ab
i don't know what i'm doing with travis ci, maybe this?
CAH-peterhewitt 9f738eb
take out emulator no-skin and no-audio options
CAH-peterhewitt d711de9
fix spoon output not including variant name
CAH-peterhewitt 36b61ee
lets try this again, minus the AndroidTest part
CAH-peterhewitt 2cf2ef9
update to work with changes in spoon snapshot instrumentationArgs is …
CAH-peterhewitt 6a74471
fix other places using instrumentationArgs as list
CAH-peterhewitt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
36 changes: 22 additions & 14 deletions
36
example/app/src/androidTest/java/com/stanfy/spoon/example/test/AnotherMainActivityTest.java
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
4 changes: 2 additions & 2 deletions
4
example/app/src/androidTest/java/com/stanfy/spoon/example/test/CustomTestRunner.java
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
48 changes: 30 additions & 18 deletions
48
example/app/src/androidTest/java/com/stanfy/spoon/example/test/MainActivityTest.java
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 |
---|---|---|
@@ -1,58 +1,70 @@ | ||
package com.stanfy.spoon.example.test; | ||
|
||
import android.test.ActivityInstrumentationTestCase2; | ||
import android.test.suitebuilder.annotation.SmallTest; | ||
import android.test.suitebuilder.annotation.MediumTest; | ||
import android.support.test.annotation.UiThreadTest; | ||
import android.support.test.rule.ActivityTestRule; | ||
import android.support.test.runner.AndroidJUnit4; | ||
import android.test.suitebuilder.annotation.LargeTest; | ||
import android.test.UiThreadTest; | ||
import android.test.suitebuilder.annotation.MediumTest; | ||
import android.test.suitebuilder.annotation.SmallTest; | ||
import android.widget.TextView; | ||
|
||
import com.squareup.spoon.Spoon; | ||
import com.squareup.spoon.SpoonRule; | ||
import com.stanfy.spoon.example.MainActivity; | ||
|
||
import org.junit.Rule; | ||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
|
||
import static junit.framework.Assert.assertEquals; | ||
import static junit.framework.Assert.assertNotNull; | ||
|
||
/** | ||
* Tests for MainActivity. | ||
*/ | ||
public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActivity> { | ||
|
||
@RunWith(AndroidJUnit4.class) | ||
public class MainActivityTest { | ||
|
||
public MainActivityTest() { | ||
super(MainActivity.class); | ||
} | ||
@Rule | ||
public final SpoonRule spoon = new SpoonRule(); | ||
@Rule | ||
public final ActivityTestRule<MainActivity> activityRule = | ||
new ActivityTestRule<>(MainActivity.class); | ||
|
||
@Test | ||
@UiThreadTest | ||
public void testSetText() throws Throwable { | ||
final MainActivity act = getActivity(); | ||
final MainActivity act = activityRule.getActivity(); | ||
final TextView text = (TextView) act.findViewById(android.R.id.text1); | ||
assertNotNull(text); | ||
Spoon.screenshot(act, "startup"); | ||
spoon.screenshot(act, "startup"); | ||
|
||
final int steps = 5; | ||
for (int i = 1; i <= steps; i++) { | ||
final String step = String.valueOf(i); | ||
act.setText(step); | ||
Spoon.screenshot(act, "step-" + i); | ||
spoon.screenshot(act, "step-" + i); | ||
assertEquals(text.getText().toString(), step); | ||
} | ||
|
||
} | ||
|
||
@SmallTest | ||
public void testSmallTest() throws Throwable { | ||
final MainActivity act = getActivity(); | ||
Spoon.screenshot(act, "startup-smallTest"); | ||
final MainActivity act = activityRule.getActivity(); | ||
spoon.screenshot(act, "startup-smallTest"); | ||
} | ||
|
||
@MediumTest | ||
public void testMediumTest() throws Throwable { | ||
final MainActivity act = getActivity(); | ||
Spoon.screenshot(act, "startup-mediumTest"); | ||
final MainActivity act = activityRule.getActivity(); | ||
spoon.screenshot(act, "startup-mediumTest"); | ||
} | ||
|
||
@LargeTest | ||
public void testLargeTest() throws Throwable { | ||
final MainActivity act = getActivity(); | ||
Spoon.screenshot(act, "startup-largeTest"); | ||
final MainActivity act = activityRule.getActivity(); | ||
spoon.screenshot(act, "startup-largeTest"); | ||
} | ||
|
||
} |
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you update it to 3.0.1 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Try using https://github.com/jaredsburrows/gradle-spoon-plugin.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually I am trying :)