-
Notifications
You must be signed in to change notification settings - Fork 79
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 a test where the admin can delete a user's message
Fixes #6891
- Loading branch information
1 parent
fa56c0b
commit cd98460
Showing
16 changed files
with
118 additions
and
7 deletions.
There are no files selected for viewing
Binary file modified
BIN
+21 KB
(110%)
...s/community_members/0x0a8c8e4202f744043753c9b931556fddc266f6b6def43d6692dda7efac6e1cb5.db
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
...mmunity_members/0x0a8c8e4202f744043753c9b931556fddc266f6b6def43d6692dda7efac6e1cb5.db-shm
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
...mmunity_members/0x0a8c8e4202f744043753c9b931556fddc266f6b6def43d6692dda7efac6e1cb5.db-wal
Binary file not shown.
Binary file not shown.
Binary file not shown.
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
24 changes: 24 additions & 0 deletions
24
test/ui-test/testSuites/suite_communities/shared/scripts/bdd_hooks.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,24 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
# This file contains hook functions to run as the .feature file is executed. | ||
# | ||
# A common use-case is to use the OnScenarioStart/OnScenarioEnd hooks to | ||
# start and stop an AUT, e.g. | ||
# | ||
# @OnScenarioStart | ||
# def hook(context): | ||
# startApplication("addressbook") | ||
# | ||
# @OnScenarioEnd | ||
# def hook(context): | ||
# currentApplicationContext().detach() | ||
# | ||
# See the section 'Performing Actions During Test Execution Via Hooks' in the Squish | ||
# manual for a complete reference of the available API. | ||
|
||
# Detach (i.e. potentially terminate) all AUTs at the end of a scenario | ||
@OnScenarioEnd | ||
def hook(context): | ||
for ctx in applicationContextList(): | ||
ctx.detach() | ||
|
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_communities/shared/steps/steps.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,31 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
# A quick introduction to implementing scripts for BDD tests: | ||
# | ||
# This file contains snippets of script code to be executed as the .feature | ||
# file is processed. See the section 'Behaviour Driven Testing' in the 'API | ||
# Reference Manual' chapter of the Squish manual for a comprehensive reference. | ||
# | ||
# The decorators Given/When/Then/Step can be used to associate a script snippet | ||
# with a pattern which is matched against the steps being executed. Optional | ||
# table/multi-line string arguments of the step are passed via a mandatory | ||
# 'context' parameter: | ||
# | ||
# @When("I enter the text") | ||
# def whenTextEntered(context): | ||
# <code here> | ||
# | ||
# The pattern is a plain string without the leading keyword, but a couple of | ||
# placeholders including |any|, |word| and |integer| are supported which can be | ||
# used to extract arbitrary, alphanumeric and integer values resp. from the | ||
# pattern; the extracted values are passed as additional arguments: | ||
# | ||
# @Then("I get |integer| different names") | ||
# def namesReceived(context, numNames): | ||
# <code here> | ||
# | ||
# Instead of using a string with placeholders, a regular expression can be | ||
# specified. In that case, make sure to set the (optional) 'regexp' argument | ||
# to True. | ||
|
||
import names |
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
43 changes: 43 additions & 0 deletions
43
test/ui-test/testSuites/suite_communities/tst_communityAdminFlows/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,43 @@ | ||
#****************************************************************************** | ||
# Status.im | ||
#*****************************************************************************/ | ||
#/** | ||
# * \file test.feature | ||
# * | ||
# * \test Status Desktop - Community Member Flows | ||
# * \date August 2022 | ||
# ** | ||
# *****************************************************************************/ | ||
|
||
Feature: Status Desktop community admin features | ||
|
||
As an admin I want to interact in a community | ||
|
||
@relyon-mailserver | ||
# TODO we need the mailserver to get the message we want to delete | ||
Scenario: Admin can delete another member's message | ||
# User 1 Bobby sends a message | ||
Given the user starts the application with a specific data folder "../../../fixtures/community_members" | ||
When the user "Bobby" logs in with password "TesTEr16843/!@00" | ||
Then the user lands on the signed in app | ||
When the user opens the community named "MyFriends" | ||
Then the user lands on the community named "MyFriends" | ||
When the user switches to "general" chat | ||
# Buffer message so that we are sure that once deleted, the last message will not be and old one | ||
And the user sends a chat message "Wholesome message" | ||
And the user sends a chat message "I sure hope no admin will delete this message" | ||
Then the last chat message contains "I sure hope no admin will delete this message" | ||
|
||
# User 2 Alice (admin) logs in | ||
Given the user restarts the app | ||
And the user "Alive" logs in with password "TesTEr16843/!@00" | ||
Then the user lands on the signed in app | ||
When the user opens the community named "MyFriends" | ||
Then the user lands on the community named "MyFriends" | ||
And the last chat message contains "I sure hope no admin will delete this message" | ||
|
||
# Deleting the message | ||
When the user deletes the message at index 0 | ||
Then the last message displayed is not "I sure hope no admin will delete this message" | ||
|
||
|
9 changes: 9 additions & 0 deletions
9
test/ui-test/testSuites/suite_communities/tst_communityAdminFlows/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,9 @@ | ||
source(findFile('scripts', 'python/bdd.py')) | ||
|
||
setupHooks('../../global_shared/scripts/bdd_hooks.py') | ||
collectStepDefinitions('./steps', '../shared/steps/', '../../global_shared/steps/', '../../suite_onboarding/shared/steps/', '../../suite_messaging/shared/steps/') | ||
|
||
|
||
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