From 2c9771a269c34578282ca0fcb9e1a6700a3bcf32 Mon Sep 17 00:00:00 2001 From: BryceLTaylor Date: Fri, 1 Oct 2021 14:39:13 -0400 Subject: [PATCH 1/4] Update Chromedriver --- package-lock.json | 46 +++++++++++++++++++++++----------------------- package.json | 2 +- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/package-lock.json b/package-lock.json index 272aefa36..58d06c430 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2975,12 +2975,12 @@ "integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==" }, "axios": { - "version": "0.21.1", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.1.tgz", - "integrity": "sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA==", + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz", + "integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==", "dev": true, "requires": { - "follow-redirects": "^1.10.0" + "follow-redirects": "^1.14.0" } }, "babel-cli": { @@ -4990,13 +4990,13 @@ } }, "chromedriver": { - "version": "92.0.1", - "resolved": "https://registry.npmjs.org/chromedriver/-/chromedriver-92.0.1.tgz", - "integrity": "sha512-LptlDVCs1GgyFNVbRoHzzy948JDVzTgGiVPXjNj385qXKQP3hjAVBIgyvb/Hco0xSEW8fjwJfsm1eQRmu6t4pQ==", + "version": "94.0.0", + "resolved": "https://registry.npmjs.org/chromedriver/-/chromedriver-94.0.0.tgz", + "integrity": "sha512-x4hK7R7iOyAhdLHJEcOyGBW/oa2kno6AqpHVLd+n3G7c2Vk9XcAXMz84XhNItqykJvTc6E3z/JRIT1eHYH//Eg==", "dev": true, "requires": { "@testim/chrome-version": "^1.0.7", - "axios": "^0.21.1", + "axios": "^0.21.2", "del": "^6.0.0", "extract-zip": "^2.0.1", "https-proxy-agent": "^5.0.0", @@ -6598,9 +6598,9 @@ } }, "glob": { - "version": "7.1.7", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz", - "integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", + "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", "dev": true, "requires": { "fs.realpath": "^1.0.0", @@ -6644,9 +6644,9 @@ "dev": true }, "is-glob": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", - "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", "dev": true, "requires": { "is-extglob": "^2.1.1" @@ -8110,9 +8110,9 @@ "dev": true }, "is-glob": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", - "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", "dev": true, "requires": { "is-extglob": "^2.1.1" @@ -8255,9 +8255,9 @@ "dev": true }, "fastq": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.12.0.tgz", - "integrity": "sha512-VNX0QkHK3RsXVKr9KrlUv/FoTa0NdbYoHHl7uXHv2rzyHSlxjdNAKug2twd9luJxpcyNeAgf5iPPMutJO67Dfg==", + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.13.0.tgz", + "integrity": "sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==", "dev": true, "requires": { "reusify": "^1.0.4" @@ -8865,9 +8865,9 @@ } }, "follow-redirects": { - "version": "1.14.2", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.2.tgz", - "integrity": "sha512-yLR6WaE2lbF0x4K2qE2p9PEXKLDjUjnR/xmjS3wHAYxtlsI9MLLBJUZirAHKzUZDGLxje7w/cXR49WOUo4rbsA==", + "version": "1.14.4", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.4.tgz", + "integrity": "sha512-zwGkiSXC1MUJG/qmeIFH2HBJx9u0V46QGUe3YR1fXG8bXQxq7fLj0RjLZQ5nubr9qNJUZrH+xUcwXEoXNpfS+g==", "dev": true }, "font-atlas": { diff --git a/package.json b/package.json index 4a949788b..6a4e1273c 100644 --- a/package.json +++ b/package.json @@ -76,7 +76,7 @@ "babel-preset-es2015": "6.22.0", "babel-preset-react": "6.22.0", "bowser": "1.9.4", - "chromedriver": "92.0.1", + "chromedriver": "94.0.0", "classnames": "2.2.5", "cookie": "0.4.1", "copy-webpack-plugin": "4.6.0", From 53b79f64fe48cb242a1c80ed6c340088b7ee4076 Mon Sep 17 00:00:00 2001 From: BryceLTaylor Date: Fri, 1 Oct 2021 14:42:25 -0400 Subject: [PATCH 2/4] Use unique comment for each silo using silo name --- test/integration/comments.test.js | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/test/integration/comments.test.js b/test/integration/comments.test.js index e61a0e3fc..0a59a14f3 100644 --- a/test/integration/comments.test.js +++ b/test/integration/comments.test.js @@ -29,10 +29,18 @@ let profileUrl = `${rootUrl}/users/${username2}`; let studioId = process.env.COMMENT_STUDIO_ID || 10005646; let studioUrl = `${rootUrl}/studios/${studioId}/comments`; +// setup comments to leave let date = new Date(); let dateString = `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()} ` + `${date.getHours()}:${date.getMinutes()}:${date.getSeconds()}`; let buildNumber = process.env.CIRCLE_BUILD_NUM || dateString; +let projectComment = buildNumber + ' project'; +let profileComment = buildNumber + ' profile'; +let studioComment = buildNumber + ' studio'; + +// let projectReply = buildNumber + ' project reply'; +// let profileReply = buildNumber + ' profile reply'; +// let studioReply = buildNumber + ' studio reply'; if (remote) { jest.setTimeout(60000); @@ -62,8 +70,8 @@ describe('comment tests', async () => { // leave the comment let commentBox = await findByXpath('//textArea[@name="compose-comment"]'); - await commentBox.sendKeys(buildNumber); - await findByXpath(`//textarea[contains(text(), "${buildNumber}")]`); + await commentBox.sendKeys(projectComment); + await findByXpath(`//textarea[contains(text(), "${projectComment}")]`); await clickXpath('//button[@class="button compose-post"]'); // reload the page @@ -85,7 +93,7 @@ describe('comment tests', async () => { // leave the comment let commentXpath = await '//form[@id="main-post-form"]/div/textArea'; let commentArea = await findByXpath(commentXpath); - await commentArea.sendKeys(buildNumber); + await commentArea.sendKeys(profileComment); await clickXpath('//div[@class="button small"]/a[contains(text(), "Post")]'); // reload page @@ -107,8 +115,8 @@ describe('comment tests', async () => { // leave the comment let commentBox = await findByXpath('//textArea[@name="compose-comment"]'); - await commentBox.sendKeys(buildNumber); - await findByXpath(`//textarea[contains(text(), "${buildNumber}")]`); + await commentBox.sendKeys(studioComment); + await findByXpath(`//textarea[contains(text(), "${studioComment}")]`); await clickXpath('//button[@class="button compose-post"]'); // reload the page From 6571ddb34dcb8279a778bf70aa776f4e45801a0a Mon Sep 17 00:00:00 2001 From: BryceLTaylor Date: Fri, 1 Oct 2021 14:43:36 -0400 Subject: [PATCH 3/4] Add tests for comment notifications --- test/integration/comments.test.js | 46 +++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/test/integration/comments.test.js b/test/integration/comments.test.js index 0a59a14f3..810006c88 100644 --- a/test/integration/comments.test.js +++ b/test/integration/comments.test.js @@ -129,4 +129,50 @@ 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 + }); From 2ada55b590a9476e7c82da51a8fb0cab029def22 Mon Sep 17 00:00:00 2001 From: BryceLTaylor Date: Mon, 4 Oct 2021 09:32:46 -0400 Subject: [PATCH 4/4] remove commented out lines in comments test --- test/integration/comments.test.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/test/integration/comments.test.js b/test/integration/comments.test.js index 810006c88..f42a4b50e 100644 --- a/test/integration/comments.test.js +++ b/test/integration/comments.test.js @@ -38,10 +38,6 @@ let projectComment = buildNumber + ' project'; let profileComment = buildNumber + ' profile'; let studioComment = buildNumber + ' studio'; -// let projectReply = buildNumber + ' project reply'; -// let profileReply = buildNumber + ' profile reply'; -// let studioReply = buildNumber + ' studio reply'; - if (remote) { jest.setTimeout(60000); } else {