apstanisic / zmaj

Zmaj is a headless CMS for managing database
https://zmaj.vercel.app
MIT License
5 stars 0 forks source link

Add ability to namespace e2e tests #15

Open apstanisic opened 1 year ago

apstanisic commented 1 year ago

It should listen for api requests, and modify them for current type It should accept suffix, and collection, and should add that filter for every request to that collection Naive example:

await page.route("**/*", (route) => {
    const url = route.request().url()
    const obj = new URL(url)
    const query = qsParse(obj.search)
    const newFilter = joinFilters(query.filter, filter) //{ title: { $like: `%${postTitleAppend}` } })
    obj.search = qsStringify({ ...query, filter: newFilter })
    void route.continue({ url: obj.toString() })
})
apstanisic commented 1 year ago

It works in chromium and in webkit, but not in firefox: ff error: CORS Missing allow origin. It works normally in when not changing url