-
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 'feat/multi-image-minds-3153' into 'master'
Feat/multi image minds#3153 See merge request minds/front!2020
- Loading branch information
Showing
65 changed files
with
5,720 additions
and
2,090 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,42 @@ | ||
Feature: Composer | ||
As a user | ||
I want to create activity posts | ||
So that I can share content | ||
|
||
Scenario: one attachments by upload button | ||
Given I am logged in | ||
And I am on the newsfeed | ||
And I have clicked on the sidebar composer button | ||
When I add files via the upload button | ||
| filename | | ||
| image1.jpg | | ||
Then I should see 1 previews of my selected imaged | ||
When I click the post button | ||
Then I am able to create the post | ||
|
||
Scenario: two attachments by upload button | ||
Given I am logged in | ||
And I am on the newsfeed | ||
And I have clicked on the sidebar composer button | ||
When I add files via the upload button | ||
| filename | | ||
| image1.jpg | | ||
| image2.jpg | | ||
Then I should see 2 previews of my selected imaged | ||
When I click the post button | ||
Then I am able to create the post | ||
|
||
Scenario: title input doesnt show if no attachments | ||
Given I am logged in | ||
And I am on the newsfeed | ||
And I have clicked on the sidebar composer button | ||
Then I should not see the title input | ||
|
||
Scenario: title input shows when attachments | ||
Given I am logged in | ||
And I am on the newsfeed | ||
And I have clicked on the sidebar composer button | ||
When I add files via the upload button | ||
| filename | | ||
| image1.jpg | | ||
Then I should see the title input |
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,13 @@ | ||
require('dotenv').config(); | ||
const { I } = inject(); | ||
|
||
class CommonPage { | ||
/** | ||
* Opens the composer from the sidebar | ||
*/ | ||
public openSidebarComposer(): void { | ||
I.click('[data-ref=sidenav-composer]'); | ||
} | ||
} | ||
|
||
export = CommonPage; |
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,10 @@ | ||
export class ComposerModal { | ||
private modalElementTag = 'm-composer__modal'; | ||
|
||
/** | ||
* The wrapper element for the title input | ||
*/ | ||
public getTextareaTitle(): CodeceptJS.Locator { | ||
return locate(`${this.modalElementTag} .m-composerTextarea__title`); | ||
} | ||
} |
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,6 @@ | ||
require('dotenv').config(); | ||
const { I } = inject(); | ||
|
||
export = { | ||
newsfeedURI: '/', | ||
}; |
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 |
---|---|---|
@@ -1,11 +1,20 @@ | ||
namespace CommonSteps { | ||
const { I, loginPage } = inject(); | ||
|
||
Given('I am logged in', (): void => { | ||
I.amOnPage(loginPage.loginURI); | ||
loginPage.login(loginPage.validUsername, loginPage.validPassword); | ||
I.seeCookie('minds_sess'); | ||
}); | ||
Given( | ||
'I am logged in', | ||
async (): Promise<void> => { | ||
if (await I.grabCookie('minds_sess')) { | ||
return; | ||
} | ||
|
||
I.amOnPage(loginPage.loginURI); | ||
loginPage.login(loginPage.validUsername, loginPage.validPassword); | ||
I.seeCookie('minds_sess'); | ||
} | ||
); | ||
|
||
Given('I am logged out', (): void => void 0); | ||
Given('I am logged out', (): void => { | ||
I.clearCookie('minds_sess'); | ||
}); | ||
} |
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,56 @@ | ||
import CommonPage from '../pages/commonPage'; | ||
import { ComposerModal } from '../pages/composerModal'; | ||
|
||
namespace ComposerSteps { | ||
const { I, newsfeedPage } = inject(); | ||
|
||
const commonPage = new CommonPage(); | ||
const composerModal = new ComposerModal(); | ||
|
||
Given('I am on the newsfeed', () => { | ||
I.amOnPage(newsfeedPage.newsfeedURI); | ||
}); | ||
|
||
Given('I have clicked on the sidebar composer button', () => { | ||
commonPage.openSidebarComposer(); | ||
}); | ||
|
||
When('I add files via the upload button', table => { | ||
const tableByHeader = table.parse().hashes(); | ||
for (const row of tableByHeader) { | ||
// TODO how do we make sure we're using the correct context (ie. modal or inline?) | ||
I.attachFile( | ||
'm-composer__modal [data-cy=upload-button] input[type=file]', | ||
'../supporting-files/' + row.filename | ||
); | ||
} | ||
}); | ||
|
||
When('I click the post button', () => { | ||
I.click('m-composer__modal [data-cy=post-button]'); | ||
}); | ||
|
||
Then('I should see {int} previews of my selected imaged', num => { | ||
for (let i = 1; i <= num; i++) { | ||
I.seeElement( | ||
locate('m-composer__modal m-composerpreview--attachment').at(i) | ||
); | ||
} | ||
}); | ||
|
||
// | ||
|
||
Then('I should not see the title input', () => { | ||
I.dontSeeElement(composerModal.getTextareaTitle()); | ||
}); | ||
|
||
Then('I should see the title input', () => { | ||
I.seeElement(composerModal.getTextareaTitle()); | ||
}); | ||
|
||
// | ||
|
||
Then('I am able to create the post', () => { | ||
// TODOD | ||
}); | ||
} |
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.
Oops, something went wrong.