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

How can we pass url as parameter using typescript. While trying so I am getting an error. #4042

Closed
soumya-gobant opened this issue Jul 18, 2019 · 5 comments
Assignees
Labels
STATE: Auto-locked An issue has been automatically locked by the Lock bot. TYPE: question The issue contains a question that won't be addressed.

Comments

@soumya-gobant
Copy link

soumya-gobant commented Jul 18, 2019

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".

@need-response-app need-response-app bot added the STATE: Need response An issue that requires a response or attention from the team. label Jul 18, 2019
@AlexKamaev AlexKamaev self-assigned this Jul 18, 2019
@AlexKamaev
Copy link
Contributor

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 tsc util and I got the equal message:
error TS2554: Expected 1 arguments, but got 2.

I recommend you rewrite the .page definition in the following manner:

fixture `Getting Started`
    .page(config.baseUrl);

I should resolve the issue.

@AlexKamaev AlexKamaev added TYPE: question The issue contains a question that won't be addressed. and removed STATE: Need response An issue that requires a response or attention from the team. labels Jul 18, 2019
@soumya-gobant
Copy link
Author

Thanks @AlexKamaev for your prompt response.

@need-response-app need-response-app bot added the STATE: Need response An issue that requires a response or attention from the team. label Jul 19, 2019
@arubtsov arubtsov removed the STATE: Need response An issue that requires a response or attention from the team. label Jul 19, 2019
@lock
Copy link

lock bot commented Jul 29, 2019

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.

@lock lock bot added the STATE: Auto-locked An issue has been automatically locked by the Lock bot. label Jul 29, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jul 29, 2019
@AndreyBelym
Copy link
Contributor

Actually, there is a problem in our TypeScript definitions. I'll fix it ASAP.

@AndreyBelym AndreyBelym reopened this Jul 30, 2019
@AndreyBelym AndreyBelym removed the STATE: Auto-locked An issue has been automatically locked by the Lock bot. label Jul 30, 2019
@DevExpress DevExpress unlocked this conversation Jul 30, 2019
@lock
Copy link

lock bot commented Aug 9, 2019

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.

@lock lock bot added the STATE: Auto-locked An issue has been automatically locked by the Lock bot. label Aug 9, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Aug 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
STATE: Auto-locked An issue has been automatically locked by the Lock bot. TYPE: question The issue contains a question that won't be addressed.
Projects
None yet
Development

No branches or pull requests

4 participants