Skip to content
New issue

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

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

Already on GitHub? # to your account

Final end to end test and fixed #269

Merged
merged 23 commits into from
Jun 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
822573b
feat: corrected announcement card
alexandre-mrt May 29, 2024
a6c82da
Merge branch 'main' into solve-layout-and-announcement-problems
alexandre-mrt May 29, 2024
46bb86b
fix: user that has no events is notified accordingly
alexandre-mrt May 29, 2024
326ef42
fix: add announcement layout
alexandre-mrt May 29, 2024
4df0851
Merge branch 'main' into solve-layout-and-announcement-problems
alexandre-mrt May 29, 2024
deb9f65
fix: resolved conflicts
alexandre-mrt May 29, 2024
268dcd1
test: fix some tests
alexandre-mrt May 29, 2024
0800fc7
feat: added the selected announcement's interest on announcement crea…
alexandre-mrt May 29, 2024
11aa2d5
feat: display of the selected interests
alexandre-mrt May 29, 2024
45c7e92
test: fixed test
alexandre-mrt May 29, 2024
5152920
test: achieved coverage
alexandre-mrt Jun 1, 2024
e1a23e7
test: fix
alexandre-mrt Jun 1, 2024
fd250a7
test: fixed
alexandre-mrt Jun 1, 2024
d9e7381
fix: solved issue rendering user events on external profile
alexandre-mrt Jun 2, 2024
567fe6d
test: added end-to-end test
alexandre-mrt Jun 2, 2024
a12d772
feat: merge for end to end
alexandre-mrt Jun 2, 2024
5bcd123
fix: typo ProfileInterest name
alexandre-mrt Jun 2, 2024
03a6833
feat: fixed profileEvent Rendering
alexandre-mrt Jun 2, 2024
7748920
test: end to end
alexandre-mrt Jun 2, 2024
6fc3387
fix: dummy screen removed
alexandre-mrt Jun 2, 2024
1f43fc9
fix: dummy screen removed
alexandre-mrt Jun 2, 2024
2e0d299
fix: dummy screen removed
alexandre-mrt Jun 2, 2024
efc38f8
fix: jest test
alexandre-mrt Jun 2, 2024
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
49 changes: 0 additions & 49 deletions __test__/components/Notification/NotificationTest.test.tsx

This file was deleted.

104 changes: 104 additions & 0 deletions __test__/end-to-end/app-end-to-end.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
# flow.yaml


appId: com.epfl.uniconnect
## Can have some problem if the user is connectect to google and a pop up appears asking to save of note the google account
---
- launchApp:
clearState: true
- startRecording: end-to-end-demo

- tapOn: "Username or email"
- inputText: "email@oui.com"
- tapOn: "Password"
- inputText: "VeryHard6_"
- tapOn: "Log In"
- tapOn:
point: "50%,53%"
- tapOn: "Search..."
- inputText: "Pedro"
- tapOn:
point: "92%,91%"
- tapOn: "Interests"
- tapOn: "Events"
- tapOn:
id: "event-card-Book Club Meeting"
- tapOn:
id: "back-arrow"
- tapOn:
id: "back-arrow"
- tapOn: ", Explore"
- tapOn: "Music and Arts Festival"
- tapOn: "Participate"
- tapOn:
id: "back-arrow"
- tapOn: "Map View"
- tapOn:
id: "back-arrow"
- tapOn: "Announcements"
- tapOn: "Create an announcement"
- tapOn: "Chemistry x Python"
- inputText: "test Demo"
- hideKeyboard
- tapOn:
text: 
index: 2
- tapOn: "Photography"
- tapOn:
id: "WritingID"
- tapOn: "Search"
- inputText: "Gardening"
- "hideKeyboard"
- tapOn:
text: "Gardening"
index: 1
- tapOn: "Add a location"
- tapOn:
point: "50%,53%"
- tapOn: "Confirm"
- tapOn: "Validate"
- tapOn: "Events"
- tapOn: "Music and Arts Festival"
- tapOn: "Withdraw"
- tapOn:
id: "back-arrow"
- tapOn: "Create an event"
- tapOn:
id: "back-arrow"
- tapOn:
point: "50%,93%"
- tapOn: ", Network"
- tapOn: "List"
- tapOn: "Gaël Conditos "
- tapOn: "Interests"
- tapOn: "Events"
- tapOn:
id: "back-arrow"
- tapOn:
id: "profile-button"
- tapOn: ", QR"
- tapOn:
id: "back-arrow"
- tapOn: "Map View"
- tapOn:
id: "back-arrow"
- tapOn: "Update"
- tapOn: "Enter your description here"
- tapOn:
text: "magnifiqueDemo"
index: 0
- tapOn:
id: "com.google.android.inputmethod.latin:id/0_resource_name_obfuscated"
index: 48
- tapOn: "Done"
- tapOn:
id: "back-button"
- tapOn:
id: "back-arrow"
- tapOn:
id: "settings-button"
- tapOn: "ABOUT"
- tapOn:
id: "back-arrow"
- tapOn: "LOG OUT"
- stopRecording
4 changes: 2 additions & 2 deletions __test__/end-to-end/app-presentation.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# flow.yaml

#replace by the right appId
appId: com.alexandremrt.uniconnect

appId: com.epfl.uniconnect
# need to have a connected user
---
- launchApp
Expand Down
9 changes: 6 additions & 3 deletions __test__/end-to-end/#-test.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
# flow.yaml

#replace by the right appId
appId: com.alexandremrt.uniconnect
appId: com.epfl.uniconnect
# need to run registrationM4 before
---
- launchApp
- launchApp:
clearState: true

- tapOn: "Username or email"
- inputText: "email@oui.com"
- tapOn: "Password"
- inputText: "VeryHard6_"
- tapOn : "Log In"
- tapOn:
id: "login-btn"
point: "50%,25%"


32 changes: 0 additions & 32 deletions __test__/end-to-end/registration-test.yaml

This file was deleted.

14 changes: 7 additions & 7 deletions __test__/end-to-end/registrationM4.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@

# flow.yaml

#replace by the right appId
appId: com.alexandremrt.uniconnect
appId: com.epfl.uniconnect
---
- launchApp
- launchApp:
clearState: true
- startRecording: recording
- tapOn: "Dont have an account?"
- tapOn: "First name"
Expand All @@ -29,13 +29,13 @@ appId: com.alexandremrt.uniconnect
- tapOn: "Writing"
- tapOn: "Next"
- tapOn: "****************"
- inputText: "VeryHard6_"
- inputText: "VeryHard7_"
- tapOn: "****************"
- inputText: "VeryHard6_"
- inputText: "VeryHard7_"
- tapOn: "E-mail"
- inputText: "email@oui.com"
- inputText: "emaill@oui.com"
- tapOn: "Confirm your e-mail"
- inputText: "email@oui.com"
- inputText: "emaill@oui.com"
- "hideKeyboard"
- tapOn: "Confirm"
- tapOn: "Not now"
Expand Down
23 changes: 22 additions & 1 deletion __test__/screens/Explore/EventScreen.test.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@


import { fireEvent, render, waitFor } from '@testing-library/react-native'
import EventScreen from '../../../screens/Explore/EventScreen/EventScreen'
import React from 'react'
Expand Down Expand Up @@ -48,6 +49,22 @@ jest.mock('@react-navigation/native', () => {
}
})

jest.mock('../../../firebase/User.ts', () => ({
getUserData: jest.fn(() => Promise.resolve({
uid: "1234",
email: "test",
firstName: "alex",
lastName: "doe",
friends: [],
date: new Date(),
description: "test description",
location: "test location",
selectedInterests: [],
profilePicture: "test.jpg",
events: []
}))
}))

export type User = {
uid: string
email: string
Expand Down Expand Up @@ -91,19 +108,23 @@ jest.mock('../../../firebase/ManageEvents', () => ({





describe('EventScreen', () => {

it('refresh', async () => {


const { getByText } = render(
<NavigationContainer>

<EventScreen onEventPress={() => { }} userID='123' />

<EventScreen onEventPress={() => { }} userID='123' />
</NavigationContainer>
)
await waitFor (() => {
expect(getByText('Upcoming Events')).toBeTruthy()
expect(getByText('Past Events')).toBeTruthy()

})
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@ describe("ExternalProfileScreen", () => {

await waitFor(() => {
fireEvent.press(getByText("Network"))
expect(getByText("Message")).toBeTruthy()
expect(getByText("Remove")).toBeTruthy()
})
})
Expand Down
8 changes: 6 additions & 2 deletions __test__/screens/Profile/ProfileEvents/ProfileEvents.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,11 @@ describe("ProfileEvents", () => {
})

it("renders EventScreen with userID", async () => {
const userID : string = "123"

const { getByText } = render(
<NavigationContainer>
<ProfileEvents />
<ProfileEvents userId={userID} />
</NavigationContainer>
)
await waitFor(() => {
Expand All @@ -73,9 +75,11 @@ describe("ProfileEvents", () => {
})

it("navigates to ViewEvent when an event is pressed", async () => {
const userID = "123"

const { getByText } = render(
<NavigationContainer>
<ProfileEvents />
<ProfileEvents userId={userID}/>
</NavigationContainer>
)

Expand Down
Loading
Loading