Skip to content

Commit 463929a

Browse files
committed
Add tests to CI
1 parent bfda042 commit 463929a

File tree

4 files changed

+16
-10
lines changed

4 files changed

+16
-10
lines changed

.github/workflows/tests.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,19 @@ jobs:
5858
with:
5959
node-version: "14.x"
6060
- name: Install dependencies
61-
run: yarn --dev && yarn --cwd ./playgrounds/html
61+
run: yarn --dev && yarn --cwd ./tests/env/browser
62+
- name: Download the latest stable version of Meilisearch
63+
run: |
64+
curl -L https://install.meilisearch.com | sh
65+
chmod +x meilisearch
66+
- name: Run Meilisearch
67+
run: |
68+
./meilisearch --master-key=masterKey --no-analytics true &
6269
- name: Browser tests
6370
uses: cypress-io/github-action@v2
6471
with:
6572
# Your starting script
66-
start: yarn playground
73+
start: yarn test:browser
6774
# Creates and uploads GitHub artifacts in case of failure
6875
- uses: actions/upload-artifact@v2
6976
if: failure()

cypress/integration/first_tests.specs.js renamed to cypress/integration/search.specs.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,15 @@ describe(`My first test`, () => {
1616
})
1717

1818
it('Should check if autocomplete is visible during typing', () => {
19-
cy.get('#docs-searchbar-suggestion').type('Quick')
19+
cy.get('#docs-searchbar-suggestion').type('gett')
2020
cy.get('#meilisearch-autocomplete-listbox-0').should('be.visible')
2121
cy.get('div.dsb-suggestion:nth-child(1)') // the first entry should be "Quick start"
22-
.contains('Quick start')
22+
.contains('Getting started')
2323
})
2424

2525
it('Should test all other subheadings', () => {
2626
cy.get('div.dsb-suggestion:nth-child(2)') // the second entry should be "Download and launch"
27-
.contains('Download and launch')
28-
cy.get('div.dsb-suggestion:nth-child(3)') // the third entry should be "Add documents"
29-
.contains('Add documents')
27+
.contains('FAQ')
3028
})
3129

3230
it('Should have valid placeholder text', () => {

jest.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ module.exports = {
33
bail: true,
44
resetMocks: true,
55
restoreMocks: true,
6-
testPathIgnorePatterns: ['/node_modules/', '/dist/', '/docs/'],
6+
testPathIgnorePatterns: ['/node_modules/', '/dist/', '/docs/', '/tests/env'],
77
}

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@
2222
"lint:fix": "eslint --fix .",
2323
"test": "./scripts/test",
2424
"test:watch": "./scripts/test-watch",
25-
"test:e2e:watch": "concurrently --kill-others -s first \"yarn playground\" \"cypress open\"",
26-
"test:e2e": "concurrently --kill-others -s first \"yarn playground\" \"cypress run\""
25+
"test:browser": "yarn --cwd ./tests/env/browser && yarn --cwd ./tests/env/browser setup && yarn --cwd ./tests/env/browser serve",
26+
"test:e2e:watch": "concurrently --kill-others -s first \"yarn test:browser\" \"cypress open\"",
27+
"test:e2e": "concurrently --kill-others -s first \"yarn test:browser\" \"cypress run\""
2728
},
2829
"files": [
2930
"dist/"

0 commit comments

Comments
 (0)