-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(community): add e2e test that creates a community
Fixes #6445
- Loading branch information
1 parent
2847849
commit 1dfd153
Showing
11 changed files
with
151 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
from enum import Enum | ||
import time | ||
import sys | ||
from drivers.SquishDriver import * | ||
from drivers.SquishDriverVerification import * | ||
|
||
|
||
class MainCommunityPortalScreen(Enum): | ||
CREATE_COMMUNITY_BUTTON: str = "communitiesPortalLayoutContainer_createCommunityButton_StatusButton" | ||
|
||
|
||
class CreateCommunityPopup(Enum): | ||
SCROLL_BAR: str = "mainWallet_Add_Account_Popup_Main" | ||
COMMUNITY_NAME_INPUT: str = "createCommunityNameInput_TextEdit" | ||
COMMUNITY_DESCRIPTION_INPUT: str = "createCommunityDescriptionInput_TextEdit" | ||
NEXT_SCREEN_BUTTON: str = "createCommunityNextBtn_StatusButton" | ||
COMMUNITY_INTRO_MESSAGE_INPUT: str = "createCommunityIntroMessageInput_TextEdit" | ||
COMMUNITY_OUTRO_MESSAGE_INPUT: str = "createCommunityOutroMessageInput_TextEdit" | ||
DO_CREATE_COMMUNITY_BUTTON: str = "createCommunityFinalBtn_StatusButton" | ||
|
||
class StatusCommunityPortalScreen: | ||
|
||
def __init__(self): | ||
verify_screen(MainCommunityPortalScreen.CREATE_COMMUNITY_BUTTON.value) | ||
|
||
|
||
def createCommunity(self, communityName: str, communityDescription: str, introMessage: str, outroMessage: str): | ||
click_obj_by_name(MainCommunityPortalScreen.CREATE_COMMUNITY_BUTTON.value) | ||
|
||
type(CreateCommunityPopup.COMMUNITY_NAME_INPUT.value, communityName) | ||
type(CreateCommunityPopup.COMMUNITY_DESCRIPTION_INPUT.value, communityDescription) | ||
click_obj_by_name(CreateCommunityPopup.NEXT_SCREEN_BUTTON.value) | ||
|
||
type(CreateCommunityPopup.COMMUNITY_INTRO_MESSAGE_INPUT.value, introMessage) | ||
type(CreateCommunityPopup.COMMUNITY_OUTRO_MESSAGE_INPUT.value, outroMessage) | ||
click_obj_by_name(CreateCommunityPopup.DO_CREATE_COMMUNITY_BUTTON.value) |
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,26 @@ | ||
# ****************************************************************************** | ||
# Status.im | ||
# *****************************************************************************/ | ||
# /** | ||
# * \file StatusCommunityScreen.py | ||
# * | ||
# * \date July 2022 | ||
# * \brief Community Screen. | ||
# *****************************************************************************/ | ||
|
||
|
||
from enum import Enum | ||
from drivers.SquishDriver import * | ||
from drivers.SquishDriverVerification import * | ||
|
||
|
||
class CommunityScreenComponents(Enum): | ||
COMMUNITY_HEADER_BUTTON = "mainWindow_communityHeader_StatusChatInfoButton" | ||
COMMUNITY_HEADER_NAME_TEXT= "community_ChatInfo_Name_Text" | ||
|
||
|
||
class StatusCommunityScreen: | ||
|
||
def __init__(self, communityName): | ||
verify_screen(CommunityScreenComponents.COMMUNITY_HEADER_BUTTON.value) | ||
verify_text_matching(CommunityScreenComponents.COMMUNITY_HEADER_NAME_TEXT.value, communityName) |
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
25 changes: 25 additions & 0 deletions
25
test/ui-test/testSuites/suite_status/shared/steps/communitySteps.py
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,25 @@ | ||
|
||
from screens.StatusMainScreen import StatusMainScreen | ||
from screens.StatusCommunityPortalScreen import StatusCommunityPortalScreen | ||
from screens.StatusCommunityScreen import StatusCommunityScreen | ||
|
||
_statusCommunitityPortal = StatusCommunityPortalScreen() | ||
_statusMainScreen = StatusMainScreen() | ||
|
||
|
||
@Then("the user opens the community portal section") | ||
def step(context: any): | ||
_statusMainScreen.open_community_portal() | ||
|
||
@Then("the user lands on the community portal section") | ||
def step(context): | ||
StatusCommunityPortalScreen() | ||
|
||
@When("the user creates a community named |any|, with description |any|, intro |any| and outro |any|") | ||
def step(context, community_name, community_description, community_intro, community_outro): | ||
_statusCommunitityPortal.createCommunity(community_name, community_description, community_intro, community_outro) | ||
|
||
|
||
@Then("the user lands on the community named |any|") | ||
def step(context, community_name): | ||
StatusCommunityScreen(community_name) |
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
31 changes: 31 additions & 0 deletions
31
test/ui-test/testSuites/suite_status/tst_createCommunity/test.feature
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,31 @@ | ||
#****************************************************************************** | ||
# Status.im | ||
#*****************************************************************************/ | ||
#/** | ||
# * \file test.feature | ||
# * | ||
# * \test Status Desktop - Community | ||
# * \date July 2022 | ||
# ** | ||
# *****************************************************************************/ | ||
|
||
Feature: Status Desktop community | ||
|
||
As a user I want to create a community and chat | ||
|
||
The following scenarios cover basic flows of creating a community | ||
|
||
Background: | ||
Given A first time user lands on the status desktop and generates new key | ||
When user signs up with username tester123 and password TesTEr16843/!@00 | ||
Then the user lands on the signed in app | ||
Then the user opens the community portal section | ||
Then the user lands on the community portal section | ||
|
||
Scenario Outline: User creates a community | ||
When the user creates a community named <community_name>, with description <community_description>, intro <community_intro> and outro <community_outro> | ||
Then the user lands on the community named <community_name> | ||
|
||
Examples: | ||
| community_name | community_description | community_intro | community_outro | | ||
| testCommunity1 | Community tested 1 | My intro for the community | My community outro | |
8 changes: 8 additions & 0 deletions
8
test/ui-test/testSuites/suite_status/tst_createCommunity/test.py
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,8 @@ | ||
source(findFile('scripts', 'python/bdd.py')) | ||
|
||
setupHooks('../shared/scripts/bdd_hooks.py') | ||
collectStepDefinitions('./steps', '../shared/steps', '../shared/communitySteps') | ||
|
||
def main(): | ||
testSettings.throwOnFailure = True | ||
runFeatureFile('test.feature') |
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