Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Staging tharee #24

Open
wants to merge 44 commits into
base: staging
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
c4e454f
Add Item completed with validations
probablyshabina May 5, 2023
3914b7b
Merge remote-tracking branch 'origin/staging-shabina' into staging-sh…
probablyshabina May 5, 2023
0a8955a
Product Add Completed
probablyshabina May 5, 2023
e8755f6
merge origin/staging
probablyshabina May 5, 2023
4896611
merge origin/staging
probablyshabina May 5, 2023
eb98623
Merge remote-tracking branch 'origin/staging-shabina' into staging-sh…
probablyshabina May 5, 2023
37dd322
Connected the flow for manage items
probablyshabina May 5, 2023
971aab1
View Items recyclerview added
probablyshabina May 5, 2023
334c055
Added GardenDashboard
Thareendra2000 May 6, 2023
e35a1e7
Added Garden Dashboard
Thareendra2000 May 6, 2023
b89ed14
Passed gardenID & name to VolunteerBtn
Thareendra2000 May 6, 2023
51d764b
Fixed Garden activity bottom nav bar errors
Thareendra2000 May 6, 2023
f21e97f
Merge branch 'staging' of github.com:Thareendra2000/Gro-app into stag…
Thareendra2000 May 6, 2023
45bbfb7
Image view id
Thareendra2000 May 6, 2023
e3a62c7
Product CRUD completed
probablyshabina May 6, 2023
de71627
Merge branch 'staging' of github.com:Thareendra2000/Gro-app into stag…
Thareendra2000 May 6, 2023
8c89ac7
Cart PickUp function completed
saputhebeast May 6, 2023
3a1454d
Merge branch 'staging-shabina' into staging-sapumal
probablyshabina May 6, 2023
5ed6f72
Merge pull request #33 from Thareendra2000/staging-sapumal
probablyshabina May 6, 2023
849ed5d
Cart PickUp function updated
saputhebeast May 6, 2023
9c3054e
Merge remote-tracking branch 'origin/staging-sapumal' into staging-sa…
saputhebeast May 6, 2023
76c83e7
Home activity updated
saputhebeast May 6, 2023
a094a29
OrderStatus Approval Completed
probablyshabina May 6, 2023
57021e3
Completed the Dashboard
Thareendra2000 May 6, 2023
9a782f7
Merge remote-tracking branch 'origin/staging-sapumal'
probablyshabina May 6, 2023
5ba9b95
Temp
saputhebeast May 6, 2023
cea31b6
Ratings function implemented
saputhebeast May 6, 2023
4dcb292
Added rating to items
saputhebeast May 6, 2023
c5417b8
Added changes to Dashboard
Thareendra2000 May 6, 2023
566d2a0
Added placeholder values
saputhebeast May 6, 2023
d215863
Changed manifest file to login first
saputhebeast May 6, 2023
9e6d691
Fix issues
saputhebeast May 6, 2023
7d449e3
Test cases added
probablyshabina May 6, 2023
f2e6acc
to revert later
probablyshabina May 6, 2023
126d4b1
Revert "Test cases added"
probablyshabina May 6, 2023
c95960f
Revert "to revert later"
probablyshabina May 6, 2023
c0317aa
Revert "Revert "Test cases added""
probablyshabina May 6, 2023
6b41461
Test added
saputhebeast May 6, 2023
2da2634
Updated
saputhebeast May 6, 2023
db703e0
Merge branch 'shabina-sapumal-integrate' into staging-shabina-temp
probablyshabina May 6, 2023
203423e
Merge pull request #35 from Thareendra2000/staging-shabina-temp
probablyshabina May 6, 2023
89e3505
Updated
saputhebeast May 6, 2023
0b80d7e
chamged leaderboard icon
probablyshabina May 9, 2023
06a06c5
Merge branch 'shabina-sapumal-integrate' into staging-tharee
Thareendra2000 May 10, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion app/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/build
/build
.idea
50 changes: 47 additions & 3 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ android {
namespace 'com.example.groapp'
compileSdk 33

testOptions {
unitTests {
includeAndroidResources = true
returnDefaultValues = true
}
}

defaultConfig {
applicationId "com.example.groapp"
minSdk 19
Expand All @@ -31,9 +38,14 @@ android {
kotlinOptions {
jvmTarget = '1.8'
}
buildFeatures {
viewBinding true

testOptions {
unitTests {
includeAndroidResources = true
}
}


}

dependencies {
Expand All @@ -45,9 +57,13 @@ dependencies {
implementation 'com.google.firebase:firebase-database-ktx:20.2.0'
implementation 'androidx.test:core-ktx:1.4.0'
implementation 'androidx.test.ext:junit-ktx:1.1.5'
implementation 'androidx.test:runner:1.5.2'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
androidTestImplementation 'androidx.test:rules:1.4.0'
implementation 'com.google.android.material:material:1.5.0'


implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-play-services:1.1.1'

Expand All @@ -68,4 +84,32 @@ dependencies {
// to display images
implementation 'com.github.bumptech.glide:glide:4.12.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.12.0'
}


implementation 'com.google.firebase:firebase-storage:20.0.0'


testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'


testImplementation 'org.mockito:mockito-core:3.12.4'
testImplementation 'org.mockito:mockito-inline:3.12.4'
implementation 'androidx.test:runner:1.5.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'

testImplementation 'org.mockito:mockito-core:3.12.4'
androidTestImplementation 'org.mockito:mockito-android:3.12.4'

testImplementation "org.robolectric:robolectric:4.6.1"
testImplementation "androidx.test:core:1.3.0"

androidTestImplementation 'com.android.support.test:rules:1.0.2'
androidTestImplementation 'androidx.test:runner:1.1.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'

}

apply plugin: 'com.google.gms.google-services'
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
package com.example.groapp
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.action.ViewActions.*
import androidx.test.espresso.assertion.ViewAssertions.*
import androidx.test.espresso.matcher.ViewMatchers.*
import androidx.test.ext.junit.rules.ActivityScenarioRule
import androidx.test.ext.junit.runners.AndroidJUnit4
import com.example.groapp.Activities.Garden.AddGardenActivity
import org.junit.Before
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith

@RunWith(AndroidJUnit4::class)
class AddGardenActivityTest {

@get:Rule
val activityRule = ActivityScenarioRule(AddGardenActivity::class.java)

private lateinit var name: String
private lateinit var address: String
private lateinit var phoneNo: String
private lateinit var location: String
private lateinit var description: String
private lateinit var area: String

@Before
fun setUp() {
name = "Test Garden"
address = "Test Address"
phoneNo = "1234567890"
location = "Test Location URL"
description = "Test Description"
area = "Test Area"
}

@Test
fun testSaveGardenData() {
onView(withId(R.id.gardenName)).perform(clearText(), typeText(name), closeSoftKeyboard())
onView(withId(R.id.gardenAddress)).perform(clearText(), typeText(address), closeSoftKeyboard())
onView(withId(R.id.gardenPhoneNo)).perform(clearText(), typeText(phoneNo), closeSoftKeyboard())
onView(withId(R.id.gardenLocation)).perform(clearText(), typeText(location), closeSoftKeyboard())
onView(withId(R.id.gardenArea)).perform(clearText(), typeText(area), closeSoftKeyboard())
onView(withId(R.id.gardenDescription)).perform(clearText(), typeText(description), closeSoftKeyboard())
onView(withId(R.id.gardenSubmitBtn)).perform(click())
onView(withText("Data inserted successfully")).check(matches(isDisplayed()))
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package com.example.groapp

import androidx.test.core.app.ActivityScenario
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.action.ViewActions.click
import androidx.test.espresso.assertion.ViewAssertions.matches
import androidx.test.espresso.matcher.ViewMatchers.*
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.LargeTest
import com.example.groapp.Activities.Cart.CartPendingActivity
import com.example.groapp.Adapters.CartPendingAdapter
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith

@RunWith(AndroidJUnit4::class)
@LargeTest
class CartPendingActivityTest {
@Before
fun setUp() {
ActivityScenario.launch(CartPendingActivity::class.java)
}

@Test
fun verifyCartNavigationButtons() {
onView(withId(R.id.backImg)).check(matches(isDisplayed())).perform(click())
onView(withId(R.id.tvPending)).check(matches(isDisplayed())).perform(click())
onView(withId(R.id.tvPickUp)).check(matches(isDisplayed())).perform(click())
onView(withId(R.id.tvCompleted)).check(matches(isDisplayed())).perform(click())
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package com.example.groapp
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.assertion.ViewAssertions.matches
import androidx.test.espresso.matcher.ViewMatchers.withId
import androidx.test.espresso.matcher.ViewMatchers.withText
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.rule.ActivityTestRule
import com.example.groapp.Activities.Garden.GardenDashboardActivity
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith

@RunWith(AndroidJUnit4::class)
class GardenDashboardActivityTest {

@get:Rule
val activityRule = ActivityTestRule(GardenDashboardActivity::class.java)

@Test
fun testMostProfitableProduct() {
onView(withId(R.id.pName)).check(matches(withText("product")))
}
}
30 changes: 30 additions & 0 deletions app/src/androidTest/java/com/example/groapp/ItemCardViewTest.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import android.support.test.rule.ActivityTestRule
import org.junit.Test
import org.junit.runner.RunWith
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.LargeTest
import com.example.groapp.Activities.MainActivity
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.assertion.ViewAssertions.matches
import androidx.test.espresso.matcher.ViewMatchers.*
import org.junit.Rule
import com.example.groapp.R;

@RunWith(AndroidJUnit4::class)
@LargeTest
class ItemCardLayoutTest {

@get:Rule
val activityRule = ActivityTestRule(MainActivity::class.java)

@Test
fun testLayoutDisplayedCorrectly() {
onView(withId(R.id.ItemCardDetails)).check(matches(isDisplayed()))
onView(withId(R.id.tvCatItemImage)).check(matches(isDisplayed()))
onView(withId(R.id.tvItemName)).check(matches(isDisplayed()))
onView(withId(R.id.tvItemDescription)).check(matches(isDisplayed()))
onView(withId(R.id.tvItemPrice)).check(matches(isDisplayed()))
onView(withId(R.id.tvItemBestBefore)).check(matches(isDisplayed()))
onView(withId(R.id.tvItemRatings)).check(matches(isDisplayed()))
}
}
Loading