Skip to content

Commit

Permalink
Merge branch 'develop' into refactor/parallelize-e2e-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
souzaramon committed Aug 2, 2022
2 parents fc1f94e + 0343424 commit ad00800
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 7 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,17 @@ jobs:
done;
exit $s
- name: Cache Playwright binaries
uses: actions/cache@v3
id: cache-playwright
with:
path: |
~/.cache/ms-playwright
# This is the version of Playwright that we are using, if you are willing to upgrade, you should update this.
key: playwright-1.23.1

- name: Install Playwright
if: steps.cache-playwright.outputs.cache-hit != 'true'
run: |
cd ./apps/meteor
npx playwright install --with-deps
Expand Down Expand Up @@ -636,6 +646,15 @@ jobs:
done;
exit $s
- name: Cache Playwright binaries
uses: actions/cache@v3
id: cache-playwright
with:
path: |
~/.cache/ms-playwright
# This is the version of Playwright that we are using, if you are willing to upgrade, you should update this.
key: playwright-1.23.1

- name: Install Playwright
run: |
cd ./apps/meteor
Expand Down
4 changes: 2 additions & 2 deletions apps/meteor/app/api/server/v1/im.ts
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ API.v1.addRoute(
.toArray();

const { cursor, totalCount } = Rooms.findPaginated(
{ type: 'd', _id: { $in: subscriptions } },
{ t: 'd', _id: { $in: subscriptions } },
{
sort,
skip: offset,
Expand All @@ -451,7 +451,7 @@ API.v1.addRoute(
return API.v1.success({
ims,
offset,
count,
count: ims.length,
total,
});
},
Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import * as constants from './tests/e2e/config/constants';
export default {
globalSetup: require.resolve('./tests/e2e/config/global-setup.ts'),
use: {
headless: false,
headless: true,
ignoreHTTPSErrors: true,
trace: 'retain-on-failure',
baseURL: constants.BASE_URL,
Expand Down
29 changes: 25 additions & 4 deletions apps/meteor/tests/end-to-end/api/04-direct-message.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,18 @@ describe('[Direct Messages]', function () {
.expect(200)
.expect((res) => {
expect(res.body).to.have.property('success', true);
expect(res.body).to.have.property('count');
expect(res.body).to.have.property('total');
expect(res.body).to.have.property('count', 1);
expect(res.body).to.have.property('total', 1);
expect(res.body).to.have.property('ims').and.to.be.an('array');
const im = res.body.ims[0];
expect(im).to.have.property('_id');
expect(im).to.have.property('t').and.to.be.eq('d');
expect(im).to.have.property('msgs').and.to.be.a('number');
expect(im).to.have.property('usernames').and.to.be.an('array');
expect(im).to.have.property('lm');
expect(im).to.have.property('_updatedAt');
expect(im).to.have.property('ts');
expect(im).to.have.property('lastMessage');
})
.end(done);
});
Expand All @@ -202,8 +212,19 @@ describe('[Direct Messages]', function () {
.expect(200)
.expect((res) => {
expect(res.body).to.have.property('success', true);
expect(res.body).to.have.property('count');
expect(res.body).to.have.property('total');
expect(res.body).to.have.property('count', 1);
expect(res.body).to.have.property('total', 1);
expect(res.body).to.have.property('ims').and.to.be.an('array');
const im = res.body.ims[0];
expect(im).to.have.property('_id');
expect(im).to.have.property('t').and.to.be.eq('d');
expect(im).to.have.property('msgs').and.to.be.a('number');
expect(im).to.have.property('usernames').and.to.be.an('array');
expect(im).to.have.property('ro');
expect(im).to.have.property('sysMes');
expect(im).to.have.property('_updatedAt');
expect(im).to.have.property('ts');
expect(im).to.have.property('lastMessage');
})
.end(done);
});
Expand Down

0 comments on commit ad00800

Please sign in to comment.