-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'fix/quote-media-modals-5816' into 'master'
Activity modals for quote posts #5816 See merge request minds/front!2114
- Loading branch information
Showing
11 changed files
with
230 additions
and
8 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
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,17 @@ | ||
const { I } = inject(); | ||
|
||
/** | ||
* Component for Acivity Modal | ||
*/ | ||
export class ActivityModalComponent { | ||
private modalElementSelector: string = 'm-activityv2__modal'; | ||
|
||
/** | ||
* Whether modal is visible. | ||
* @returns { void } | ||
*/ | ||
public shouldBeVisible(): void { | ||
I.waitForElement(this.modalElementSelector, 30); | ||
I.seeElement(this.modalElementSelector); | ||
} | ||
} |
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,47 @@ | ||
Feature: Activity Feature | ||
As a user | ||
I should be able to interact with various activity types | ||
|
||
Scenario: Single image in a quote posts opens in a modal from newsfeed | ||
Given I am logged in | ||
And I am on the newsfeed | ||
And I create a post with text storage key "quote-media-modal-single-img-newsfeed" | ||
And I quote the activity with the storage text "quote-media-modal-single-img-newsfeed" and file names | ||
| filename | | ||
| image1.jpg | | ||
When I click the parent media for the quote post in the "newsfeed" with storage text "quote-media-modal-single-img-newsfeed" | ||
Then I should see the activity modal | ||
|
||
Scenario: Single image in a quote posts opens in a modal from single entity page | ||
Given I am logged in | ||
And I am on the newsfeed | ||
And I create a post with text storage key "quote-media-modal-single-img-single-entity-page" | ||
And I quote the activity with the storage text "quote-media-modal-single-img-single-entity-page" and file names | ||
| filename | | ||
| image1.jpg | | ||
When I click the timestamp for the activity with the storage key "quote-media-modal-single-img-single-entity-page" on "newsfeed" | ||
And I click the parent media for the quote post in the "single-entity-page" with storage text "quote-media-modal-single-img-single-entity-page" | ||
Then I should see the activity modal | ||
|
||
Scenario: Multi image in a quote posts opens in a modal from newsfeed | ||
Given I am logged in | ||
And I am on the newsfeed | ||
And I create a post with text storage key "quote-media-modal-multi-img-newsfeed" | ||
And I quote the activity with the storage text "quote-media-modal-multi-img-newsfeed" and file names | ||
| filename | | ||
| image1.jpg | | ||
| image2.jpg | | ||
When I click the parent media for the quote post in the "newsfeed" with storage text "quote-media-modal-multi-img-newsfeed" | ||
Then I should see the activity modal | ||
|
||
Scenario: Multi image in a quote posts opens in a modal from single entity page | ||
Given I am logged in | ||
And I am on the newsfeed | ||
And I create a post with text storage key "quote-media-modal-multi-img-single-entity-page" | ||
And I quote the activity with the storage text "quote-media-modal-multi-img-single-entity-page" and file names | ||
| filename | | ||
| image1.jpg | | ||
| image2.jpg | | ||
When I click the timestamp for the activity with the storage key "quote-media-modal-multi-img-single-entity-page" on "single-entity-page" | ||
And I click the parent media for the quote post in the "single-entity-page" with storage text "quote-media-modal-multi-img-single-entity-page" | ||
Then I should see the activity modal |
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { ActivityFeedPage } from './activityFeedPage'; | ||
|
||
export class SingleEntityPage extends ActivityFeedPage {} |
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,13 @@ | ||
import { ActivityModalComponent } from '../components/activityModalComponent'; | ||
|
||
namespace ActivityModalSteps { | ||
const activityModal = new ActivityModalComponent(); | ||
|
||
Before(() => {}); | ||
|
||
Then('I should see the activity modal', () => { | ||
activityModal.shouldBeVisible(); | ||
}); | ||
|
||
After(() => {}); | ||
} |
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,65 @@ | ||
import { ActivityModalComponent } from '../components/activityModalComponent'; | ||
import { Storage } from '../helpers/storage'; | ||
import { ComposerModal } from '../pages/composerModal'; | ||
import { NewsfeedPage } from '../pages/newsfeedPage'; | ||
import { SingleEntityPage } from '../pages/singleEntityPage'; | ||
|
||
namespace ActivitySteps { | ||
const newsfeedPage = new NewsfeedPage(); | ||
const singleEntityPage = new SingleEntityPage(); | ||
const composerModal = new ComposerModal(); | ||
const storage = Storage.getInstance(); | ||
|
||
Before(() => {}); | ||
|
||
Given( | ||
'I quote the activity with the storage text {string} and file names', | ||
async (storageKey: string, table: any) => { | ||
const storedText: string = storage.get(storageKey); | ||
await newsfeedPage.clickToQuoteActivityByText(storedText); | ||
composerModal.typeInTextArea('Quote post'); | ||
const tableByHeader = table.parse().hashes(); | ||
const fileNames = tableByHeader.map(fileName => fileName.filename); | ||
|
||
if (fileNames.length) { | ||
await composerModal.attachFiles(fileNames); | ||
} | ||
|
||
await composerModal.clickPostAndAwait(); | ||
} | ||
); | ||
|
||
When( | ||
'I click the parent media for the quote post in the {string} with storage text {string}', | ||
async (feedType: string, textStorageKey: string) => { | ||
const text: string = storage.get(textStorageKey); | ||
switch (feedType) { | ||
case 'newsfeed': | ||
newsfeedPage.hasActivityWithText(text); | ||
await newsfeedPage.clickOnParentMediaForQuotePostWithText(text); | ||
break; | ||
case 'single-entity-page': | ||
singleEntityPage.hasActivityWithText(text); | ||
await singleEntityPage.clickOnParentMediaForQuotePostWithText(text); | ||
break; | ||
} | ||
} | ||
); | ||
|
||
When( | ||
'I click the timestamp for the activity with the storage key {string} on {string}', | ||
async (textStorageKey: string, feedType: string) => { | ||
const text: string = storage.get(textStorageKey); | ||
switch (feedType) { | ||
case 'newsfeed': | ||
await newsfeedPage.clickTimestampForActivityWithText(text); | ||
break; | ||
case 'single-entity-page': | ||
await singleEntityPage.clickTimestampForActivityWithText(text); | ||
break; | ||
} | ||
} | ||
); | ||
|
||
After(() => {}); | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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