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
Kamila/solo game basic #104
Merged
Merged
Changes from all commits
Commits
Show all changes
98 commits
Select commit
Hold shift + click to select a range
362b7c4
GameManager: basic Game Manager to set songs and score
kamilababayeva 0581774
GenreTemporary: testing
kamilababayeva 21ee32c
TypingGame: modify for GameManager needs
kamilababayeva d50e2aa
Solve merge issues
kamilababayeva 6e6c1c6
LastfmApi.kt: add extra fields for uri
kamilababayeva cb5a0d3
acctivity_end_basic_game.xml: add basic end screen with game score
kamilababayeva 0b0900d
AndroidManifest.xml: adding basic end screen for game
kamilababayeva ec495d3
EndBasicGameActivity.kt: activity to show end of the game
kamilababayeva e29a32a
LastfmUri.kt: adding extra filed for artisit, set some defaults
kamilababayeva b5db280
Lastfmhelper.kt: remove helper to combine lists for current version
kamilababayeva 59b50f2
SongList.kt: add function to shuffle the list of songList
kamilababayeva ccf8851
SongList.kt: separate json field for methods, small fixes
kamilababayeva e747c03
SongList.kt: small fixes and todo
kamilababayeva 4530520
activity_genre_temporary.xml: add buttons for genre
kamilababayeva 673dd88
SongList.kt: fix the comments
kamilababayeva 90b6f57
GenreTemporary.kt: add onclick for buttons
kamilababayeva 030eb82
EndBasicGameActivity.kt: add text to display in the end
kamilababayeva bacbf25
TypingGameActivity.kt: add function to play one Game
kamilababayeva ed63959
TypingGameActivity.kt: modify barTime for new gameManager
kamilababayeva f478984
TypingGameActivity.kt: modify typing game for gameManager
kamilababayeva 201fc5c
TypingGameActivity.kt: small fixes
kamilababayeva 39c70e2
TypingGameActivity.kt: make handler global
kamilababayeva 804c55d
fixes in the imports
kamilababayeva bc60ec3
GameManager.kt: functions to opreate mediaplayer
kamilababayeva 91b1f59
TypingGameActivity.kt: function to operate songs
kamilababayeva bbb2b58
GenreTemporaryTest.kt: remove wrong tests
kamilababayeva 514c759
fixes to adapt to the new code
kamilababayeva 98cc130
TypingGameActivity.kt: organize a file
kamilababayeva df3ae9c
TypingGameActivityTest.kt: fix the typing game activity
kamilababayeva 3c33ff3
GameManager: change setNextSong to correct functionality
kamilababayeva d97adcd
GenreTemporaryTest.kt: update the tests
kamilababayeva eb9c3cf
GameManager.kt: move to another folder
kamilababayeva b38cca3
Merge branch 'main' into kamila/SoloGame_basic
kamilababayeva b015fed
remove the test
kamilababayeva 9c74957
fix the tests
kamilababayeva 2a692ba
Merge branch 'main' into kamila/SoloGame_basic
kamilababayeva 503b9f5
new tests, add odcumentation
kamilababayeva c1f1e6a
Merge branch 'main' into kamila/SoloGame_basic
kamilababayeva e3b5a61
more documentation and tests
kamilababayeva 9cc8deb
fix the comment
kamilababayeva c8e08bd
change Genre temporary that causes error
kamilababayeva 1c9b695
changing genre temporary mistake
kamilababayeva f2a701e
change the file name
kamilababayeva 3903180
change the filename
kamilababayeva 214c1f7
GameManagerTest.kt: add test to test functionalities
kamilababayeva 2359c6c
GenreTemporary: add tests and fix the functionality
kamilababayeva e88d4dc
EndBasicGameTemporary: add test for the activity
kamilababayeva d413493
TypingGameActivityTest: add tests
kamilababayeva 8afbe29
fix the test
kamilababayeva 9fab9e0
Revert "GameManagerTest.kt: add test to test functionalities"
kamilababayeva 3b8923d
Update TypingGameActivityTest.kt
kamilababayeva d636fe8
Update TypingGameActivityTest.kt
kamilababayeva ca40a3c
Revert "EndBasicGameTemporary: add test for the activity"
kamilababayeva 5d7a338
Revert "GenreTemporary: add tests and fix the functionality"
kamilababayeva f50d6bf
try branch that worked
kamilababayeva 5392177
remove the code
kamilababayeva c8e0705
remove lyrics test
kamilababayeva 8356c8f
TypingGame: fix the tests
kamilababayeva 83ba07c
GenreTemporary: put the code backf
kamilababayeva 65eb7e3
remove tests
kamilababayeva b498552
TypingGame: remove tests
kamilababayeva 63da503
GenreTemporary: add abck the lines
kamilababayeva ccd37d9
Revert "GenreTemporary: add abck the lines"
kamilababayeva 57e60fc
add retrofit to retrieve songs
kamilababayeva cad93dc
GenreTe porary:: remove tests
kamilababayeva 3c8b6e1
GenreTemporary: put back the test
kamilababayeva 10ff89a
TypingGame: add onDestroy
kamilababayeva d732852
merge two branches
kamilababayeva 09964c5
GenreTemporaryTest: fix the tests
kamilababayeva 6a2a6d4
make a global gameManager
kamilababayeva 018d72c
EndBasicGameTemporary: add the test for the interface
kamilababayeva c26456a
LastfmAPIInterface: remove uncnecesary code
kamilababayeva e11f9fa
TypingGameActivity: make function private
kamilababayeva 677a12c
TypingGameActivityTest.kt: add extra tests
kamilababayeva 47e6c23
LastfmAPIInterface: chanvge the comment
kamilababayeva b9b1dfe
LastfmHelper: add the comment
kamilababayeva 205f770
Move checkEndScreen to TypinGameActivityTest
kamilababayeva 02f1485
add test for end activity
kamilababayeva 7e00446
Move endBasicGameScreenTest
kamilababayeva 7f73ec8
LastfmHelper: remove unnecessary code
kamilababayeva 7262a15
LastfmHelperTest: remove unnecessary test
kamilababayeva d29fe88
LastfmUri: conver data class to hashmap
kamilababayeva e1d7762
genreTemporary: simplify the code
kamilababayeva 715b7cf
change lastfmapi to retrofit
kamilababayeva dbf718d
remove tests for lastfmAPI
kamilababayeva 72c8653
Update app/src/main/java/ch/sdp/vibester/activity/TypingGameActivity.kt
kamilababayeva 0001d6b
Update app/src/main/java/ch/sdp/vibester/GenreTemporary.kt
kamilababayeva ac8b749
Update app/src/main/java/ch/sdp/vibester/helper/GameManager.kt
kamilababayeva ec51fc5
EndBasicGameTemporary: add small comment
kamilababayeva 9c85e08
remove create for retrofit interface
kamilababayeva 5c62ec4
ServiceBuilder: create common builder for retrofit
kamilababayeva 9d4fb1b
GameManager: change gamesize name
kamilababayeva eccdfe8
Update code to new retrofit builder
kamilababayeva eebfbd4
add cinstants to sleeptime
kamilababayeva 2c64d1a
remove commented code
kamilababayeva b601db4
merge main branch
kamilababayeva 5cd39c7
fix songlist type
kamilababayeva 91c5998
fix the test
kamilababayeva 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
50 changes: 50 additions & 0 deletions
50
app/src/androidTest/java/ch/sdp/vibester/EndBasicGameTemporaryTest.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,50 @@ | ||
package ch.sdp.vibester | ||
|
||
import android.content.Context | ||
import android.content.Intent | ||
import androidx.test.core.app.ActivityScenario | ||
import androidx.test.core.app.ApplicationProvider | ||
import androidx.test.espresso.Espresso | ||
import androidx.test.espresso.assertion.ViewAssertions | ||
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 ch.sdp.vibester.helper.GameManager | ||
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 EndBasicGameTemporaryTest { | ||
|
||
@get:Rule | ||
val testRule = ActivityScenarioRule(EndBasicGameTemporary::class.java) | ||
|
||
@Before | ||
fun setUp() { | ||
Intents.init() | ||
} | ||
|
||
@After | ||
fun clean() { | ||
Intents.release() | ||
} | ||
|
||
@Test | ||
fun checkTextView(){ | ||
val gameManager = GameManager() | ||
val intent = Intent(ApplicationProvider.getApplicationContext(), TypingGameActivity::class.java) | ||
val scn: ActivityScenario<TypingGameActivity> = ActivityScenario.launch(intent) | ||
val ctx = ApplicationProvider.getApplicationContext() as Context | ||
scn.onActivity { | ||
activity -> var temp = activity.playRound(ctx, gameManager) | ||
} | ||
Espresso.onView(ViewMatchers.withId(R.id.score)) | ||
.check(ViewAssertions.matches(ViewMatchers.withText("Your score is " + gameManager.getScore().toString()))) | ||
} | ||
} |
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 |
---|---|---|
|
@@ -26,6 +26,7 @@ import kotlin.random.Random | |
*/ | ||
@RunWith(AndroidJUnit4::class) | ||
class AuthenticationActivityTest { | ||
private val SLEEP_TIME:Long = 5000 | ||
|
||
@Test | ||
fun useAppContext() { | ||
|
@@ -46,7 +47,7 @@ class AuthenticationActivityTest { | |
onView(withId(R.id.username)).perform(ViewActions.typeText(username), closeSoftKeyboard()) | ||
onView(withId(R.id.password)).perform(ViewActions.typeText(password), closeSoftKeyboard()) | ||
onView(withId(R.id.logIn)).perform(click()) | ||
Thread.sleep(3_000) | ||
Thread.sleep(SLEEP_TIME) | ||
onView(withId(R.id.email)).check(matches(withText("Authentication error"))) | ||
} | ||
|
||
|
@@ -57,7 +58,7 @@ class AuthenticationActivityTest { | |
onView(withId(R.id.username)).perform(ViewActions.typeText(username), closeSoftKeyboard()) | ||
onView(withId(R.id.password)).perform(ViewActions.typeText(password), closeSoftKeyboard()) | ||
onView(withId(R.id.createAcc)).perform(click()) | ||
Thread.sleep(3_000) | ||
Thread.sleep(SLEEP_TIME) | ||
onView(withId(R.id.email)).check(matches(withText("Authentication error"))) | ||
} | ||
|
||
|
@@ -114,7 +115,7 @@ class AuthenticationActivityTest { | |
onView(withId(R.id.username)).perform(ViewActions.typeText(username), closeSoftKeyboard()) | ||
onView(withId(R.id.password)).perform(ViewActions.typeText(password), closeSoftKeyboard()) | ||
onView(withId(R.id.logIn)).perform(click()) | ||
Thread.sleep(3_000) | ||
Thread.sleep(SLEEP_TIME) | ||
onView(withId(R.id.email)).check(matches(withText("[email protected]"))) | ||
} | ||
|
||
|
@@ -126,7 +127,7 @@ class AuthenticationActivityTest { | |
onView(withId(R.id.username)).perform(ViewActions.typeText(username), closeSoftKeyboard()) | ||
onView(withId(R.id.password)).perform(ViewActions.typeText(password), closeSoftKeyboard()) | ||
onView(withId(R.id.createAcc)).perform(click()) | ||
Thread.sleep(3_000) | ||
Thread.sleep(SLEEP_TIME) | ||
onView(withId(R.id.email)).check(matches(withText(randomInt.toString().plus("@gg.com")))) | ||
} | ||
|
||
|
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.
My bad. This function can be deleted