Skip to content

Commit

Permalink
Strongly type paramaters
Browse files Browse the repository at this point in the history
  • Loading branch information
zabil committed Aug 29, 2024
1 parent ec0ec2a commit e0a9f6c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
18 changes: 9 additions & 9 deletions test/docs-tests/gauge/tests/htmlElementAPI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ export default class HtmlElementAPI {
@Step("Navigate to <url> with basic auth <username> and <password>")
public async navigateWithBasicAuth(
url: string,
username: any,
password: any,
username: string,
password: string,
) {
const encodedCredentials = Buffer.from(`${username}:${password}`).toString(
"base64",
Expand All @@ -63,7 +63,7 @@ export default class HtmlElementAPI {
public async selectDropDownValue(
value: string | number,
dropDownName: string,
fieldValue: any,
fieldValue: string,
) {
const box = dropDown(dropDownName);
await box.select(value);
Expand Down Expand Up @@ -99,7 +99,7 @@ export default class HtmlElementAPI {
}

@Step("Get value <text> of Text Box <textBoxName>")
public async getTextboxValue(text: any, textBoxName: string) {
public async getTextboxValue(text: string, textBoxName: string) {
const field = textBox(textBoxName);
assert.equal(await field.value(), text);
}
Expand All @@ -111,17 +111,17 @@ export default class HtmlElementAPI {
}

@Step("Write <text> into Text Box <textBoxName>")
public async writeInto(text: string, textBoxName: any) {
public async writeInto(text: string, textBoxName: string) {
await write(text, into(textBoxName));
}

@Step("Write <text> into TextBox with name <textboxName>")
public async writeWithName(text: string, textBoxName: any) {
public async writeWithName(text: string, textBoxName: string) {
await write(text, into(textBox({ name: textBoxName })));
}

@Step("Write <text> to Text Box <textBoxName>")
public async writeTo(text: string, textBoxName: any) {
public async writeTo(text: string, textBoxName: string) {
await write(text, to(textBoxName));
}

Expand Down Expand Up @@ -169,7 +169,7 @@ export default class HtmlElementAPI {
}

@Step("Respond to <url> with <responseBody>")
public async interceptResponse(url: string, responseBody: any) {
public async interceptResponse(url: string, responseBody: string) {
await intercept(url, { body: responseBody });
}

Expand All @@ -179,7 +179,7 @@ export default class HtmlElementAPI {
}

@Step("Intercept <url> and continue with postData <mockData>")
public async interceptRequest(url: string, mockData: any) {
public async interceptRequest(url: string, mockData: string) {
await intercept(url, (request) => {
request.continue({ postData: mockData });
});
Expand Down
1 change: 1 addition & 0 deletions test/docs-tests/gauge/tests/selectors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { $, button, link, text, textBox } from "taiko";

function getElementWithSelector(element: string, selector: string) {
let selectedElement = null;
// biome-ignore lint: Required for testing
let selectedItem;
try {
selectedItem = JSON.parse(selector);
Expand Down

0 comments on commit e0a9f6c

Please sign in to comment.