I am trying to read data from json file but I have some trouble. How can I get items from a json file to individual items?
My json file:
[
{
\"UserNam
My Test was also failing with json file then i converted my datafile into ts file like below
export const DataForSearch =
{
Login:
{
CorrectCreds: { username: 'test@test.en', password: 'tests123' }
}
};
then use this in my test case like
import {DataForSearch } from "../DataLogin"
const using = require("jasmine-data-provider");
describe("Login Page", () => {
using(DataForSearch.Login, (data: any, alldesc: any) => {
it("Login", () => {
element(by.name('username')).sendKeys(data.username);
element(by.name('password')).sendKeys(data.password);
})
})
})
you can try typescript file, if you still facing issue.If you face any issue let me know