Reconfigure comment integration tests to not sign out as much

This commit is contained in:
BryceLTaylor 2021-10-20 10:09:32 -04:00
parent e473e9f402
commit 6de944036c

View file

@ -49,19 +49,24 @@ let driver;
describe('comment tests', async () => {
beforeAll(async () => {
driver = await buildDriver('www-integration project comments');
driver.get(rootUrl);
});
afterEach(async () => {
await clickXpath('//a[contains(@class, "user-info")]');
await clickText('Sign out');
await driver.get(rootUrl);
});
afterAll(async () => await driver.quit());
test('leave comment on project', async () => {
describe('leave comments', async () => {
beforeAll(async () => {
await signIn(username1, password, driver);
await findByXpath('//span[contains(@class, "profile-name")]');
});
afterAll(async () => {
await driver.get(rootUrl);
await clickXpath('//a[contains(@class, "user-info")]');
await clickText('Sign out');
});
test('leave comment on project', async () => {
await driver.get(projectUrl);
// leave the comment
@ -82,8 +87,6 @@ describe('comment tests', async () => {
});
test('leave comment on a profile', async () => {
await signIn(username1, password, driver);
await findByXpath('//span[contains(@class, "profile-name")]');
await driver.get(profileUrl);
// leave the comment
@ -105,8 +108,6 @@ describe('comment tests', async () => {
});
test('leave comment on studio', async () => {
await signIn(username1, password, driver);
await findByXpath('//span[contains(@class, "profile-name")]');
await driver.get(studioUrl);
// leave the comment
@ -125,50 +126,7 @@ describe('comment tests', async () => {
let commentVisible = await postedComment.isDisplayed();
await expect(commentVisible).toBe(true);
});
// get notifications
test('get notification badge for comments', async () => {
await signIn(username2, password, driver);
await findByXpath('//span[contains(@class, "profile-name")]');
let messages = await findByXpath('//span[@class = "message-count show"]');
let messagesVisible = await messages.isDisplayed();
await expect(messagesVisible).toBe(true);
});
test('click notifications for comments', async () => {
await signIn(username2, password, driver);
await findByXpath('//span[contains(@class, "profile-name")]');
await clickXpath('//li[@class="link right messages"]');
let messages = await findByXpath('//ul[@class="messages-social-list"]');
let messagesVisible = await messages.isDisplayed();
await expect(messagesVisible).toBe(true);
});
test('project comment visible', async () => {
await signIn(username2, password, driver);
await findByXpath('//span[contains(@class, "profile-name")]');
await driver.get(rootUrl + '/messages');
let projectMessageXpath = '//p[@class="emoji-text mod-comment" ' +
`and contains(text(), "${projectComment}")]`;
let projectMessage = await findByXpath(projectMessageXpath);
let projectMessageVisible = await projectMessage.isDisplayed();
await expect(projectMessageVisible).toBe(true);
});
test('profile comment visible', async () => {
await signIn(username2, password, driver);
await findByXpath('//span[contains(@class, "profile-name")]');
await driver.get(rootUrl + '/messages');
let profileMessageXpath = '//p[@class="emoji-text mod-comment" ' +
`and contains(text(), "${profileComment}")]`;
let profileMessage = await findByXpath(profileMessageXpath);
let profileMessageVisible = await profileMessage.isDisplayed();
await expect(profileMessageVisible).toBe(true);
});
// studio comments do not send a notification
});