Commit 582b5a7b authored by Ben Hayward's avatar Ben Hayward

notifs dont seem to be working properly on sandbox, need to figure that out

1 merge request!492WIP: [Sprint/KiltedKoala](feat) e2e tests for notification and cleanup functions
Pipeline #75834268 running with stages
......@@ -13,11 +13,20 @@ context('Notification', () => {
let username = '';
let password = '';
const commentMessages = {
1: 'test 1',
2: 'test 2',
3: 'test 3',
};
const commentText = 'test comment';
const postText = 'test comment'
const hamburgerMenu = '.m-v2-topbar__UserMenu > m-user-menu > div.m-user-menu.m-dropdown > a';
const logoutButton = '.m-user-menu.m-dropdown > ul > li:nth-child(11) > a';
const postMenu = 'minds-activity:nth-child(2) > div > m-post-menu > button > i';
const deletePostOption = 'minds-activity:nth-child(2) m-post-menu > ul > li:nth-child(4)';
const deletePostButton = 'm-modal-confirm div:nth-child(1) > div > button.mdl-button--colored';
const channelButton = '.m-v2-topbar__Top > div > a > minds-avatar > div';
const postCommentButton = 'm-comment__poster > div > div.minds-body > div > div > a.m-post-button';
const commentButton = 'minds-activity > div.tabs > minds-button-comment > a';
const commentInput = 'm-comment__poster minds-textarea > div';
const commentContent ='.m-comment__bubble > p';
const notificationBell = 'm-notifications--topbar-toggle > a > i';
before(() => {
username = generateRandomId();
......@@ -25,14 +34,14 @@ context('Notification', () => {
// make a new post on 2nd user.
cy.newUser(username, password);
cy.post(commentMessages[1]);
cy.post(postText);
cy.logout();
});
after(() => {
cy.login(true, username, password);
cy.deleteUser(username, password);
});
// after(() => {
// cy.login(true, username, password);
// cy.deleteUser(username, password);
// });
beforeEach(() => {
cy.login();
......@@ -46,7 +55,20 @@ context('Notification', () => {
})
it('should alert the user that a post has been commented on', () => {
// Comment on generated 2nd users post.
cy.get(commentButton).first().click();
cy.get(commentInput).first().type(commentText);
cy.get(postCommentButton).first().click();
cy.get(commentContent).first().contains(commentText);
// Logout, log into generated user.
cy.logout();
cy.login(true, username, password);
// Open their notifications
cy.get(notificationBell).click();
// notifications not working on test env.
});
})
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment