Skip to content

Commit

Permalink
Merge pull request #79 from aryangupta701/tweak/zap-init
Browse files Browse the repository at this point in the history
Init to http://zap/
  • Loading branch information
psiinon authored Oct 23, 2023
2 parents 9ccb04e + f3bffc7 commit de871e4
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 7 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## Unreleased

### Changed

- Init ZAP URL to http://zap/ instead of http://localhost:8080/
## 0.0.6 - 2023-09-19

### Fixed
- Storage events not being reported.
- Storage events not being reported.
4 changes: 2 additions & 2 deletions source/Background/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ function cookieChangeHandler(
): void {
Browser.storage.sync
.get({
zapurl: 'http://localhost:8080/',
zapurl: 'http://zap/',
zapkey: 'not set',
})
.then((items) => {
Expand All @@ -321,7 +321,7 @@ Browser.runtime.onMessage.addListener(onMessageHandler);
Browser.runtime.onInstalled.addListener((): void => {
console.emoji('🦄', 'extension installed');
Browser.storage.sync.set({
zapurl: 'http://localhost:8080/',
zapurl: 'http://zap/',
zapkey: 'not set',
});
});
Expand Down
2 changes: 1 addition & 1 deletion source/Options/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function restoreOptions(): void {

Browser.storage.sync
.get({
zapurl: 'http://localhost:8080/',
zapurl: 'http://zap/',
zapkey: 'not set',
zapenable: true,
zaprecordingactive: false,
Expand Down
5 changes: 2 additions & 3 deletions test/ContentScript/integrationTests.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,7 @@ function integrationTests(
await page.close();
// Then
const expectedData =
'["{\\"action\\":{\\"action\\":\\"reportEvent\\"},\\"body\\":{\\"eventJson\\":\\"{TIMESTAMP,\\"eventName\\":\\"pageLoad\\",\\"url\\":\\"http://localhost:1801/webpages/integrationTest.html\\",\\"count\\":1}\\",\\"apikey\\":\\"not set\\"}}",' +
'"{\\"action\\":{\\"action\\":\\"reportObject\\"},\\"body\\":{\\"objectJson\\":\\"{TIMESTAMP,\\"type\\":\\"nodeAdded\\",\\"tagName\\":\\"A\\",\\"id\\":\\"\\",\\"nodeName\\":\\"A\\",\\"url\\":\\"http://localhost:1801/webpages/integrationTest.html\\",\\"href\\":\\"http://localhost:1801/webpages/integrationTest.html#test\\",\\"text\\":\\"Link\\"}\\",\\"apikey\\":\\"not set\\"}}"]';
'["{\\"action\\":{\\"action\\":\\"reportEvent\\"},\\"body\\":{\\"eventJson\\":\\"{TIMESTAMP,\\"eventName\\":\\"pageLoad\\",\\"url\\":\\"http://localhost:1801/webpages/integrationTest.html\\",\\"count\\":1}\\",\\"apikey\\":\\"not set\\"}}","{\\"action\\":{\\"action\\":\\"reportObject\\"},\\"body\\":{\\"objectJson\\":\\"{TIMESTAMP,\\"type\\":\\"nodeAdded\\",\\"tagName\\":\\"A\\",\\"id\\":\\"\\",\\"nodeName\\":\\"A\\",\\"url\\":\\"http://localhost:1801/webpages/integrationTest.html\\",\\"href\\":\\"http://localhost:1801/webpages/integrationTest.html#test\\",\\"text\\":\\"Link\\"}\\",\\"apikey\\":\\"not set\\"}}","{\\"action\\":{\\"action\\":\\"reportObject\\"},\\"body\\":{\\"objectJson\\":\\"{TIMESTAMP,\\"type\\":\\"localStorage\\",\\"tagName\\":\\"\\",\\"id\\":\\"localzapenable\\",\\"nodeName\\":\\"\\",\\"url\\":\\"http://localhost:1801/webpages/integrationTest.html\\",\\"text\\":\\"true\\"}\\",\\"apikey\\":\\"not set\\"}}","{\\"action\\":{\\"action\\":\\"reportObject\\"},\\"body\\":{\\"objectJson\\":\\"{TIMESTAMP,\\"type\\":\\"localStorage\\",\\"tagName\\":\\"\\",\\"id\\":\\"localzapurl\\",\\"nodeName\\":\\"\\",\\"url\\":\\"http://localhost:1801/webpages/integrationTest.html\\",\\"text\\":\\"http://localhost:8080/\\"}\\",\\"apikey\\":\\"not set\\"}}"]';
expect(JSON.stringify(Array.from(actualData))).toBe(expectedData);
});

Expand All @@ -77,7 +76,7 @@ function integrationTests(
await driver.setEnable(false);
const page = await context.newPage();
await page.goto(
`http://localhost:${_HTTPPORT}/webpages/integrationTest.html`
`http://localhost:${_HTTPPORT}/webpages/interactions.html`
);
await page.waitForLoadState('networkidle');
await page.waitForTimeout(1000);
Expand Down
4 changes: 4 additions & 0 deletions test/ContentScript/webpages/integrationTest.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,9 @@
</head>
<body>
<a href="#test">Link</a>
<script>
localStorage.setItem('localzapurl', "http://localhost:8080/");
localStorage.setItem('localzapenable', "true");
</script>
</body>
</html>

0 comments on commit de871e4

Please sign in to comment.