This repository has been archived by the owner on Jan 31, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
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 #148 from MaximeZmt/jwen/single-player-lyrics-game
Jwen/single player lyrics game basic version
- Loading branch information
Showing
22 changed files
with
650 additions
and
441 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
78 changes: 78 additions & 0 deletions
78
app/src/androidTest/java/ch/sdp/vibester/GenreToLyricsTest.kt
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,78 @@ | ||
package ch.sdp.vibester | ||
|
||
import androidx.test.espresso.Espresso | ||
import androidx.test.espresso.action.ViewActions | ||
import androidx.test.espresso.intent.Intents | ||
import androidx.test.espresso.intent.matcher.IntentMatchers | ||
import androidx.test.espresso.matcher.ViewMatchers | ||
import androidx.test.ext.junit.rules.ActivityScenarioRule | ||
import androidx.test.ext.junit.runners.AndroidJUnit4 | ||
import ch.sdp.vibester.activity.LyricsBelongGameActivity | ||
import org.junit.After | ||
import org.junit.Before | ||
import org.junit.Rule | ||
import org.junit.Test | ||
import org.junit.runner.RunWith | ||
|
||
@RunWith(AndroidJUnit4::class) | ||
class GenreToLyricsTest { | ||
|
||
private val sleepTime: Long = 2500 | ||
|
||
@get:Rule | ||
val testRule = ActivityScenarioRule( | ||
GenreToLyrics::class.java | ||
) | ||
|
||
@Before | ||
fun setUp() { | ||
Intents.init() | ||
} | ||
|
||
@After | ||
fun clean() { | ||
Intents.release() | ||
} | ||
|
||
@Test | ||
fun rockButtonClick() { | ||
Espresso.onView(ViewMatchers.withId(R.id.rockButton)).perform(ViewActions.click()) | ||
Thread.sleep(sleepTime) | ||
Intents.intended(IntentMatchers.hasComponent(LyricsBelongGameActivity::class.java.name)) | ||
} | ||
|
||
@Test | ||
fun topButtonClick() { | ||
Espresso.onView(ViewMatchers.withId(R.id.topTracksButton)).perform(ViewActions.click()) | ||
Thread.sleep(sleepTime) | ||
Intents.intended(IntentMatchers.hasComponent(LyricsBelongGameActivity::class.java.name)) | ||
} | ||
|
||
@Test | ||
fun kpopButtonClick() { | ||
Espresso.onView(ViewMatchers.withId(R.id.kpopButton)).perform(ViewActions.click()) | ||
Thread.sleep(sleepTime) | ||
Intents.intended(IntentMatchers.hasComponent(LyricsBelongGameActivity::class.java.name)) | ||
} | ||
|
||
@Test | ||
fun billieEilishButtonClick() { | ||
Espresso.onView(ViewMatchers.withId(R.id.billieEilishButton)).perform(ViewActions.click()) | ||
Thread.sleep(sleepTime) | ||
Intents.intended(IntentMatchers.hasComponent(LyricsBelongGameActivity::class.java.name)) | ||
} | ||
|
||
@Test | ||
fun imagineDragonsButtonClick() { | ||
Espresso.onView(ViewMatchers.withId(R.id.imagDragonsButton)).perform(ViewActions.click()) | ||
Thread.sleep(sleepTime) | ||
Intents.intended(IntentMatchers.hasComponent(LyricsBelongGameActivity::class.java.name)) | ||
} | ||
|
||
@Test | ||
fun btsButtonClick() { | ||
Espresso.onView(ViewMatchers.withId(R.id.btsButton)).perform(ViewActions.click()) | ||
Thread.sleep(sleepTime) | ||
Intents.intended(IntentMatchers.hasComponent(LyricsBelongGameActivity::class.java.name)) | ||
} | ||
} |
77 changes: 77 additions & 0 deletions
77
app/src/androidTest/java/ch/sdp/vibester/GenreToTypingTest.kt
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,77 @@ | ||
package ch.sdp.vibester | ||
|
||
import androidx.test.espresso.Espresso | ||
import androidx.test.espresso.action.ViewActions | ||
import androidx.test.espresso.intent.Intents | ||
import androidx.test.espresso.intent.matcher.IntentMatchers | ||
import androidx.test.espresso.matcher.ViewMatchers | ||
import androidx.test.ext.junit.rules.ActivityScenarioRule | ||
import androidx.test.ext.junit.runners.AndroidJUnit4 | ||
import ch.sdp.vibester.activity.TypingGameActivity | ||
import org.junit.After | ||
import org.junit.Before | ||
import org.junit.Rule | ||
import org.junit.Test | ||
import org.junit.runner.RunWith | ||
|
||
@RunWith(AndroidJUnit4::class) | ||
class GenreToTypingTest { | ||
private val sleepTime: Long = 2500 | ||
|
||
@get:Rule | ||
val testRule = ActivityScenarioRule( | ||
GenreToTyping::class.java | ||
) | ||
|
||
@Before | ||
fun setUp() { | ||
Intents.init() | ||
} | ||
|
||
@After | ||
fun clean() { | ||
Intents.release() | ||
} | ||
|
||
@Test | ||
fun rockButtonClick() { | ||
Espresso.onView(ViewMatchers.withId(R.id.rockButton)).perform(ViewActions.click()) | ||
Thread.sleep(sleepTime) | ||
Intents.intended(IntentMatchers.hasComponent(TypingGameActivity::class.java.name)) | ||
} | ||
|
||
@Test | ||
fun topButtonClick() { | ||
Espresso.onView(ViewMatchers.withId(R.id.topTracksButton)).perform(ViewActions.click()) | ||
Thread.sleep(sleepTime) | ||
Intents.intended(IntentMatchers.hasComponent(TypingGameActivity::class.java.name)) | ||
} | ||
|
||
@Test | ||
fun kpopButtonClick() { | ||
Espresso.onView(ViewMatchers.withId(R.id.kpopButton)).perform(ViewActions.click()) | ||
Thread.sleep(sleepTime) | ||
Intents.intended(IntentMatchers.hasComponent(TypingGameActivity::class.java.name)) | ||
} | ||
|
||
@Test | ||
fun billieEilishButtonClick() { | ||
Espresso.onView(ViewMatchers.withId(R.id.billieEilishButton)).perform(ViewActions.click()) | ||
Thread.sleep(sleepTime) | ||
Intents.intended(IntentMatchers.hasComponent(TypingGameActivity::class.java.name)) | ||
} | ||
|
||
@Test | ||
fun imagineDragonsButtonClick() { | ||
Espresso.onView(ViewMatchers.withId(R.id.imagDragonsButton)).perform(ViewActions.click()) | ||
Thread.sleep(sleepTime) | ||
Intents.intended(IntentMatchers.hasComponent(TypingGameActivity::class.java.name)) | ||
} | ||
|
||
@Test | ||
fun btsButtonClick() { | ||
Espresso.onView(ViewMatchers.withId(R.id.btsButton)).perform(ViewActions.click()) | ||
Thread.sleep(sleepTime) | ||
Intents.intended(IntentMatchers.hasComponent(TypingGameActivity::class.java.name)) | ||
} | ||
} |
79 changes: 0 additions & 79 deletions
79
app/src/androidTest/java/ch/sdp/vibester/LyricTemporaryTest.kt
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.