-
Notifications
You must be signed in to change notification settings - Fork 41
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
Generate TypeScript Type declarations #791
Comments
can't wait this 💯 !! |
We are waiting for this too!! |
@swathi-harwalkar1 and @kangliep take a look at the most recent type definitions in https://github.com/DefinitelyTyped/DefinitelyTyped/. Most of the objects are now defined. There are a couple missing ( We will not be updating |
would be nice! |
I'm curious: Could it be possible to use the |
Hi, I think you are referring to the fact that |
I'm a little bit confused. What's the difference between the I noticed that The new fix, can be followed with the documentation I mentioned? |
We've merged in the latest version of type definitions.
Can you elaborate on this please?
Yes, the latest version of the type definitions should now reflect the browser docs correctly. |
I was trying the new version of types/k6 with my current solution of Playwright (using POM). I was able to use the I passed the page object to my page classes, and this is the error.- Argument of type 'import("/Users/my.username/Documents/Projects/my_tests/node_modules/@types/k6/experimental/browser").Page' is not assignable to parameter of type 'import("/Users/my.username/Documents/Projects/my_tests/node_modules/playwright-core/types/types").Page'.
Type 'Page' is missing the following properties from type 'Page': addInitScript, $eval, $$eval, exposeBinding, and 36 more.ts(2345) In fact, in my page classes, I'm passing a parameter to a constructor of type My code looks like this.- import { browser } from 'k6/experimental/browser';
import { SLLoginPage } from '../pages/SLLoginPage';
import { SLProductPage } from '../pages/SLProductsPage';
let slLoginPage: SLLoginPage;
let slProductPage: SLProductPage;
export const options = {
scenarios: {
login: {
executor: 'constant-vus',
exec: 'login',
vus: 1
}
},
};
export async function login() {
const context = browser.newContext();
const page = context.newPage();
try {
slLoginPage = new SLLoginPage(page);
slProductPage = new SLProductPage(page);
await slLoginPage.goTo();
await slLoginPage.fillLoginForm(process.env.USERNAME as string, process.env.PASSWORD as string);
await page.waitForURL('**/dashboard', { timeout: 3000 });
} finally {
page.close();
} On the other hand, Thanks in advance! :) |
Hi @ArCiGo, Could you please open an issue in our community forum instead of answering in this issue 🙂 ? I'd need to see the full test script, but in general the
No plans yet to implement Cheers, |
Hi, @ankur22 ! Thanks for your response. What I want to do is load testing of my existing UI functional tests (I have different workflows that I would like to load with multiple users). Maybe we can talk in-depth about my goal in another channel. What do you think? :) Update.- I have a sample project to demo what I want. |
Hi @ArCiGo, Yes please, can you open an issue in our community forum for now, and we can go from there 👍 |
This is a global task in order to track the generation of TS Type declarations for xk6-browser, the same way it's done for k6.
Type declarations should be generated for the following APIs:
Tasks
The text was updated successfully, but these errors were encountered: