I am testing a website i.e console.internetcomputerservices.com, please refer the below code:
/// <reference types="cypress" />
describe("Basic tests", () => {
before(() => {
cy.visit("https://console.internetcomputerservices.com", {
onBeforeLoad(win) {
win.localStorage.setItem(
"token",
"my-token"
);
},
});
});
it.only("should be able to run test 1", async () => {
cy.viewport(1280, 720)
//Clicks on Creat DApp
cy.contains('Create DApp').click()
//Clicks on Static website
cy.contains('Static Website').click()
//clicks on "Connect with github"
cy.contains('Connect with github').click()
//The origin is changed to github.com inside which following operation takes place
cy.origin('https://github.com', ()=>{
cy.get('input[name="login"]').type('my-email')
cy.get('input[name="password"]').type('my-password')
cy.get('[type="submit"]').click()
cy.get('[href="/settings/installations/29576211"]').click()
cy.contains('Only select repositories').click()
cy.contains('All repositories').click()
cy.get('.js-integrations-install-form-submit.btn-primary.btn.float-left.mr-2').click()
})
//Comes out of github.com back to console.internetcomputerservices.com
//(Expected) cypress will identify the placeholder and type "intro-2"
// but this doesn't happen, cypress doesn't identify any element inside the DOM
cy.get('input[placeholder="Search…"]').type('intro-2')
});
});
When we return back to our home website, i expect that the cypress identifies the placeholder and type in "intro-2", to check that was it particular to placeholder, i realised that cypress is not able to identify any element on DOM.
If you refer the Search bar, i want to access one with placeholder='Search...'
I apologies for poor choice of words, i am beginner in this and not familiar with jargon, I hope you understand my question.