Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed a small typo #69

Merged
merged 1 commit into from
Aug 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions source/ContentScript/recorder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import {
ZestStatementElementClick,
ZestStatementElementSendKeys,
ZestStatementLaunchBrowser,
ZestStatementSwichToFrame,
ZestStatementSwitchToFrame,
} from '../types/zestScript/ZestStatement';
import {getPath} from './util';
import {ZEST_SCRIPT} from '../utils/constants';
Expand Down Expand Up @@ -53,14 +53,14 @@ class Recorder {
}
if (this.curLevel > level) {
while (this.curLevel > level) {
this.sendZestScriptToZAP(new ZestStatementSwichToFrame(-1));
this.sendZestScriptToZAP(new ZestStatementSwitchToFrame(-1));
this.curLevel -= 1;
}
this.curFrame = frameIndex;
} else {
this.curLevel += 1;
this.curFrame = frameIndex;
this.sendZestScriptToZAP(new ZestStatementSwichToFrame(frameIndex));
this.sendZestScriptToZAP(new ZestStatementSwitchToFrame(frameIndex));
}
if (this.curLevel !== level) {
console.log('Error in switching frames');
Expand Down
4 changes: 2 additions & 2 deletions source/types/zestScript/ZestStatement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ class ZestStatementWindowClose extends ZestStatement {
}
}

class ZestStatementSwichToFrame extends ZestStatement {
class ZestStatementSwitchToFrame extends ZestStatement {
frameIndex: number;

frameName: string;
Expand Down Expand Up @@ -238,7 +238,7 @@ export {
ZestStatementLaunchBrowser,
ZestStatementElementMouseOver,
ZestStatementElementClick,
ZestStatementSwichToFrame,
ZestStatementSwitchToFrame,
ZestStatementElementSendKeys,
ZestStatementElementClear,
ZestStatementWindowClose,
Expand Down
6 changes: 3 additions & 3 deletions test/ContentScript/unitTests.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import {
ElementLocator,
ZestStatementElementClick,
ZestStatementElementSendKeys,
ZestStatementSwichToFrame,
ZestStatementSwitchToFrame,
} from '../../source/types/zestScript/ZestStatement';

jest.mock('webextension-polyfill');
Expand Down Expand Up @@ -461,12 +461,12 @@ test('should return correct path for element with XPath', () => {
});

test('should generate valid frame switch statement', () => {
const zestStatementSwichToFrame = new ZestStatementSwichToFrame(
const zestStatementSwitchToFrame = new ZestStatementSwitchToFrame(
0,
'testvalue'
);

expect(zestStatementSwichToFrame.toJSON()).toBe(
expect(zestStatementSwitchToFrame.toJSON()).toBe(
'{"windowHandle":"windowHandle1","frameIndex":0,"frameName":"testvalue","parent":false,"index":-1,"enabled":true,"elementType":"ZestClientSwitchToFrame"}'
);
});