File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -178,6 +178,30 @@ jobs:
178178 if : steps.retry.outcome == 'failure'
179179 run : ${{ matrix.cmd }}
180180
181+ # Run the multitab tests in every supported browser
182+
183+ multitab :
184+ needs : lint
185+ strategy :
186+ fail-fast : false
187+ matrix :
188+ client : ['firefox', 'chromium', 'webkit']
189+ adapter : ['idb', 'indexeddb']
190+ runs-on : ubuntu-latest
191+ env :
192+ CLIENT : ${{ matrix.client }}
193+ ADAPTERS : ${{ matrix.adapter }}
194+ steps :
195+ - uses : actions/checkout@v4
196+ with :
197+ persist-credentials : false
198+ - uses : ./.github/actions/install-node-package
199+ with :
200+ node-version : ${{ env.NODE_VERSION }}
201+ - uses : ./.github/actions/build-pouchdb
202+ - run : npx playwright install --with-deps ${{ matrix.client }}
203+ - run : npm run test-multitab
204+
181205 # Run the integration, find and mapreduce tests against all the Node.js
182206 # PouchDB adapters. This should be run for every adapter on every version of
183207 # Node.js we support.
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ help fixing them though.
2222 - [ Test options] ( #test-options )
2323- [ Other sets of tests] ( #other-sets-of-tests )
2424 - [ ` find ` and ` mapreduce ` ] ( #find-and-mapreduce )
25+ - [ multi-tab tests] ( #multi-tab-tests )
2526 - [ "Fuzzy" tests] ( #fuzzy-tests )
2627 - [ Performance tests] ( #performance-tests )
2728 - [ Running tests in the browser] ( #running-tests-in-the-browser )
@@ -235,6 +236,24 @@ like so:
235236Note that the default choice for the ` SERVER ` value (` pouchdb-express-router ` )
236237does not support ` find ` or ` mapreduce ` and does not need to pass these tests.
237238
239+ ### Multi-tab tests
240+
241+ We have a few tests to check that interactions with backing stores like
242+ IndexedDB are synchronized across tabs where multiple PouchDB instances are
243+ connected to the same database. These have to be scripted via Playwright rather
244+ than being run inside the normal unit test suite. To run them:
245+
246+ $ npm run test-multitab
247+
248+ Two environment variables can be used to control how these are run:
249+
250+ - ` CLIENT ` : may be ` firefox ` , ` chromium ` or ` webkit ` to select the browser where
251+ the tests will be run.
252+ - ` ADAPTERS ` : may be ` idb ` or ` indexeddb ` to set which backend adapter PouchDB
253+ will use.
254+
255+ All combinations of these should be tested on CI.
256+
238257### "Fuzzy" tests
239258
240259This test suite checks some more unusual replication scenarios, it can be run
You can’t perform that action at this time.
0 commit comments