hospitalrun
hospitalrun copied to clipboard
Integration/E2E Acceptance
🚀 Feature Proposal
Introduce End To End and Integration testing to the Mono-Repo
Motivation
Separation of concern from the Frontend and Backend developers. Core developers can create test specifications which will act as release acceptance criteria during build time. This is done via CI triggers.
Details
./test/
folder should contain compliance for HospitalRun CLI
, HospitalRun Server
and HospitalRun FrontEnd
integrations. If Feature X
is implemented in more than one module then we should have a ./test/feature_x.spec.ts
or ./test/feature_x/index.spec.ts
that ensures modules are working in a real world environment. All modules must pass a basic smoke test prior to E2E testing via cross-env CI=true pnpm test -r
. (jsdom, cypress, unit tests, etc)
Example CI
merge feature branch
into next
branch === trigger monorepo
build with e2e/integration tests
a. Pass === release all packages (merge next into master in each changed module)
b. Fail === Notify linked issues/pull requests
Example Spec:
import {frontend, server} from 'hospitalrun'
server.start({frontend}) // start backend with server side render
// Example SSR Feature
it('should server side render the frontend', () => {
browser.url(server.uri)
const title = browser.getTitle()
assert.equal(title, 'Some Assertion')
})
// Example Offline Feature
it('should work offline', () => {
browser.url(server.uri)
// We could simulate bad connections or limited throughput scenerios
browser.setNetworkConditions({ latency: 0, throughput: 0, offline: true })
const title = browser.getTitle()
assert.equal(title, 'Some Offline Assertion')
})
// Test all core service states e2e
it('should have X feature', () => {
browser.url(server.uri)
// Do some action that would create data in the database
// $('#button').click()
const data = server.db.get('someId')
assert.equal(data._id, 'someId)
})
Backlog
- [ ] Build Triggers HospitalRun/hospitalrun-server#153
- [ ] Build Triggers HospitalRun/hospitalrun-frontend#1620
- [ ] Configure WebDriver/Selenium
- [ ] Browser Offline Render Test
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.