Skip to content

Commit 314f8ce

Browse files
bors[bot]bidoubiwa
andauthored
Merge #659
659: Remove tests on remote meilisearch server r=bidoubiwa a=bidoubiwa fixes: #642 Since tests were only done on one environment any way during CI but also local testing I removed the testing all together on playground using the remote meilisearch instance Co-authored-by: Charlotte Vermandel <[email protected]>
2 parents 583259a + 20e0ba2 commit 314f8ce

File tree

7 files changed

+29
-151
lines changed

7 files changed

+29
-151
lines changed

.github/workflows/pre-release-tests.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,7 @@ jobs:
4545
with:
4646
# Tests are only done on one playground to avoid long testing time
4747
start: yarn local:env:react
48-
env: playground=reactlocal
49-
spec: cypress/integration/local-ui.spec.js
48+
env: playground=local
5049
- uses: actions/upload-artifact@v2
5150
if: failure()
5251
with:

.github/workflows/test.yml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,23 @@ jobs:
3030
uses: actions/setup-node@v2
3131
with:
3232
node-version: "14.x"
33+
- name: Download the latest stable version of Meilisearch
34+
run: |
35+
curl -L https://install.meilisearch.com | sh
36+
chmod +x meilisearch
37+
- name: Run Meilisearch
38+
run: |
39+
./meilisearch --master-key=masterKey --no-analytics true &
3340
- name: Install dependencies
34-
run: yarn --dev && yarn --cwd ./playgrounds/vue
35-
- name: Run Browser tests
41+
run: yarn --dev && yarn --cwd ./tests/env/react
42+
- name: Setup Meilisearch Index
43+
run: yarn local:env:setup
44+
- name: Run local browser tests
3645
uses: cypress-io/github-action@v2
3746
with:
3847
# Tests are only done on one playground to avoid long testing time
39-
start: yarn playground:vue
40-
env: playground=vue
41-
spec: cypress/integration/search-ui.spec.js
48+
start: yarn local:env:react
49+
env: playground=local
4250
- uses: actions/upload-artifact@v2
4351
if: failure()
4452
with:

cypress.env.json

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,5 @@
11
{
2-
"react": {
3-
"host": "http://localhost:1111"
4-
},
5-
"angular": {
6-
"host": "http://localhost:4200"
7-
},
8-
"vue": {
9-
"host": "http://localhost:8080"
10-
},
11-
"javascript": {
12-
"host": "http://localhost:2222"
13-
},
14-
"reactlocal": {
2+
"local": {
153
"host": "http://localhost:9999"
164
}
175
}

cypress/integration/local-ui.spec.js

Lines changed: 0 additions & 85 deletions
This file was deleted.

cypress/integration/search-ui.spec.js

Lines changed: 12 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ const {
33
[playground]: { host },
44
} = Cypress.env()
55

6-
const HIT_ITEM_CLASS =
7-
playground === 'react' ? '.ais-InfiniteHits-item' : '.ais-Hits-item'
6+
const HIT_ITEM_CLASS = '.ais-InfiniteHits-item'
87

98
describe(`${playground} playground test`, () => {
109
before(() => {
@@ -17,20 +16,15 @@ describe(`${playground} playground test`, () => {
1716
})
1817

1918
it('Contains stats', () => {
20-
if (playground === 'react') cy.contains('12,546 results')
21-
if (playground === 'angular') cy.contains('12546 results')
19+
cy.contains('15 results')
2220
})
2321

2422
it('Contains filter clear', () => {
25-
if (playground === 'react') cy.contains('Clear all filters')
26-
if (playground === 'angular') cy.contains('Clear refinements')
23+
cy.contains('Clear all filters')
2724
})
2825

2926
it('Contains Genres', () => {
30-
cy.contains('Genres')
3127
cy.contains('Action')
32-
if (playground === 'react') cy.contains('5,554')
33-
if (playground === 'angular') cy.contains('5554')
3428
})
3529

3630
it('Contains searchBar', () => {
@@ -46,7 +40,7 @@ describe(`${playground} playground test`, () => {
4640
const select = `.ais-SortBy-select`
4741
cy.get(select).select('steam-video-games:recommendationCount:asc')
4842
cy.wait(1000)
49-
cy.get(HIT_ITEM_CLASS).eq(0).contains('Rag Doll Kung Fu')
43+
cy.get(HIT_ITEM_CLASS).eq(0).contains('Deathmatch Classic')
5044
})
5145

5246
it('Sort by default relevancy', () => {
@@ -57,28 +51,23 @@ describe(`${playground} playground test`, () => {
5751
})
5852

5953
it('click on facets', () => {
60-
cy.get(HIT_ITEM_CLASS).eq(0).contains('Counter-Strike')
61-
6254
const checkbox = `.ais-RefinementList-list .ais-RefinementList-checkbox`
6355
cy.get(checkbox).eq(1).click()
64-
65-
if (playground === 'react') cy.contains('1,939')
66-
if (playground === 'angular') cy.contains('1939')
67-
68-
cy.contains('Counter-Strike').should('not.exist')
56+
cy.wait(1000)
57+
cy.get(HIT_ITEM_CLASS).eq(1).contains('Team Fortress Classic')
58+
cy.get(HIT_ITEM_CLASS).eq(1).contains('4.99 $')
6959
})
7060

7161
it('Search', () => {
72-
cy.get('.ais-SearchBox-input').type('orwell')
62+
cy.get('.ais-SearchBox-input').type('Half-Life')
7363
cy.wait(1000)
74-
cy.get(HIT_ITEM_CLASS).eq(0).contains('Orwell')
75-
cy.get(HIT_ITEM_CLASS).eq(0).contains('Late 2016')
64+
cy.get(HIT_ITEM_CLASS).eq(0).contains('Half-Life')
7665
})
7766

7867
it('Unclick on facets', () => {
7968
const checkbox = `.ais-RefinementList-list .ais-RefinementList-checkbox`
8069
cy.get(checkbox).eq(0).click()
81-
cy.get(HIT_ITEM_CLASS).eq(0).contains('Orwell')
70+
cy.get(HIT_ITEM_CLASS).eq(0).contains('Half-Life')
8271
})
8372

8473
it('Placeholder Search', () => {
@@ -88,19 +77,7 @@ describe(`${playground} playground test`, () => {
8877
})
8978

9079
it('Paginate Search', () => {
91-
cy.get(HIT_ITEM_CLASS).eq(0).contains('Counter-Strike')
92-
93-
if (playground === 'react') {
94-
cy.get('.ais-InfiniteHits-loadMore').click()
95-
cy.get(HIT_ITEM_CLASS).should('have.length', 12)
96-
} else {
97-
if (playground === 'vue') {
98-
cy.get('.ais-Pagination-item').eq(3).click()
99-
} else {
100-
cy.get('.ais-Pagination-item--page').eq(1).click()
101-
}
102-
103-
cy.contains('Counter-Strike').should('not.exist')
104-
}
80+
cy.get('.ais-InfiniteHits-loadMore').click()
81+
cy.get(HIT_ITEM_CLASS).should('have.length', 11)
10582
})
10683
})

package.json

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,9 @@
88
"test:watch": "yarn test --watch",
99
"test": "jest --runInBand --selectProjects dom --selectProjects node",
1010
"test:build": "yarn build && jest --runInBand --selectProjects build",
11-
"test:e2e:all": "sh scripts/e2e.sh",
12-
"test:e2e:local": "yarn local:env:setup && concurrently --kill-others -s first \"yarn local:env:react\" \"cypress run --env playground=reactlocal --spec 'cypress/integration/local-ui.spec.js'\"",
13-
"test:e2e:local:watch": "yarn local:env:setup && concurrently --kill-others -s first \"yarn local:env:react\" \"cypress open --env playground=reactlocal\"",
11+
"test:e2e": "yarn local:env:setup && concurrently --kill-others -s first \"yarn local:env:react\" \"cypress run --env playground=local \"",
12+
"test:e2e:watch": "yarn local:env:setup && concurrently --kill-others -s first \"yarn local:env:react\" \"cypress open --env playground=local\"",
1413
"test:all": "yarn test:e2e:all && yarn test && test:build",
15-
"test:e2e": "concurrently --kill-others -s first \"yarn playground:vue\" \"cypress run --env playground=vue\"",
16-
"test:e2e:watch": "concurrently --kill-others -s first \"yarn playground:vue\" \"cypress open --env playground=vue\"",
1714
"cy:open": "cypress open",
1815
"playground:vue": "yarn --cwd ./playgrounds/vue && yarn --cwd ./playgrounds/vue serve",
1916
"playground:react": "yarn --cwd ./playgrounds/react && yarn --cwd ./playgrounds/react start",

scripts/e2e.sh

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)