-
-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(mapper): frontend login + remove temp auth from React frontend (#…
…1903) * feat(osm-logo): logo add to mapper * feat(login): login store add * fix(layer-switcher): close layer-switcher by default * feat(login): login dialog popup add * fix(login): util functions add for login * fix(login): store current path on localStorage * fix(osmAuth): if user request redirection to mapper frontend then treat as external url * feat(logo): hot logo add * fix(header): header component ui slice * feat(login): toggle modal state add * fix(layout): replace hot-header with custom header component * fix(login): replace modalOpen state on parent with stores * fix(+layout): barlow font add to root * feat(header): display username and profile image if user logged in * fix(login): signOut add * feat(drawerItems): drawer menu items add * feat(header): drawer comp add, signout func add * fix(layerSwitchMenu): width & height fix * fix(mapLegends): fix(mapLegends): show map legend in dropdown * fix(mapControlComponent): add mapLegend to mapControlComponent * fix(projectDetailsV2): remove showing map legend on accordion, btn linking to mapper frontend add * remove(login): remove temporary login from react frontend * test: persist osm login across playwright tests (temp login removed) (#1910) * test: wip persist osm login across playwright tests * test: add temp auth config as a playwright workaround * test: fix mapper flow tests, first open page, then click card * test: disable firefox and webkit tests entirely for now * docs: add note about attempting test auth with webkit * test: use btnTestId prop to identify specific button during tests --------- Co-authored-by: Sam <[email protected]> Co-authored-by: spwoodcock <[email protected]>
- Loading branch information
1 parent
c185d65
commit d175979
Showing
28 changed files
with
526 additions
and
122 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -122,5 +122,5 @@ dist | |
/playwright-report/ | ||
/blob-report/ | ||
/playwright/.cache/ | ||
|
||
playwright/.auth | ||
/e2e/.cache/ | ||
e2e/.auth |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { test as setup } from '@playwright/test'; | ||
import path from 'path'; | ||
|
||
const authFile = path.join(__dirname, './.auth/user.json'); | ||
|
||
setup('authenticate', async ({ browserName, page }) => { | ||
// Note here we only run in chromium, to avoid running this setup step | ||
// for Firefox and Webkit. | ||
// This is because Webkit does not respect 'secure' cookies on http contexts. | ||
// For this to work we would need to configure https for testing | ||
// https://github.com/hotosm/fmtm/pull/1920 | ||
setup.skip(browserName !== 'chromium', 'Test only for chromium!'); | ||
|
||
// Note this sets a token so we can proceed, but the login will be | ||
// overwritten by svcfmtm localadmin user (as DEBUG=True) | ||
await page.goto('/playwright-temp-login/'); | ||
|
||
// Now check we are signed in as localadmin | ||
await page.waitForSelector('text=localadmin'); | ||
|
||
// Save authentication state | ||
await page.context().storageState({ path: authFile }); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.