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
How can we pass url as parameter using typescript. While trying so I am getting an error. #4042
Comments
I was able to reproduce the issue. It looks like an issue in TypeScript, not in TestCafe. I can reproduce it even without TestCafe. I created a sample code: const config = { baseUrl: "http://devexpress.github.io/testcafe" };
function log(arg1) {
}
log `${config.baseUrl}`; Then I tried to compile this code using the I recommend you rewrite the fixture `Getting Started`
.page(config.baseUrl); I should resolve the issue. |
Thanks @AlexKamaev for your prompt response. |
This thread has been automatically locked since it is closed and there has not been any recent activity. Please open a new issue for related bugs or feature requests. We recommend you ask TestCafe API, usage and configuration inquiries on StackOverflow. |
Actually, there is a problem in our TypeScript definitions. I'll fix it ASAP. |
This thread has been automatically locked since it is closed and there has not been any recent activity. Please open a new issue for related bugs or feature requests. We recommend you ask TestCafe API, usage and configuration inquiries on StackOverflow. |
Please find the code snippet:
import { Selector } from 'testcafe'
import config from '../tests/config.json'
//selectors
const name = Selector('#developer-name');
const submitButton = Selector('#submit-button');
fixture
Getting Started
.page
${config.baseUrl}
;test('My first test', async t => {
await t
.typeText(name, 'John Smith')
.click(submitButton);
});
Smaple json:
{
"baseUrl": "http://devexpress.github.io/testcafe"
}
but I am not facing same issue with js. Not able to resolve above issue. it is throwing me error "Expected 1 arguments, but got 2".
The text was updated successfully, but these errors were encountered: