Closed EashBhanu-CCD closed 1 year ago
@EashBhanu-CCD
The error message:
1) Customer Page - Partner Click on customer icon & verify headers: AssertionError: Timed out retrying after 60000ms: Expected to find element://button[@type='button'][normalize-space()='New customer'], but never found it. at Context.eval (webpack://csc-external-ui-automation/./cypress/e2e/Customer.cy.js:44:33)
is not caused by GitHub Actions, so there is nothing that the action can do to fix this problem for you.
There is some general advice in the FAQs Why do my Cypress tests pass locally but not in CI? which may help you.
Since you are using Cypress 13.x
and you are recording into the Cypress Cloud under https://cloud.cypress.io/projects/f3fmt4 you should have access to Test Replay where you can visit your test and go through it step by step.
If you want the community to assist you, then you would either need to make your Cypress Cloud project f3fmt4 public or at least share your failing test spec Customer.cy.js
.
@MikeMcC399 It is difficult to make cypress cloud project public since it my organization based project but i can share Customer.cy.js
/// <references types="Cypress">
import { faker } from '@faker-js/faker'
import LoginPage from '../PageObjects/LoginPage'
import CustomerPage from '../PageObjects/CustomerPage'
let NewCustNum = faker.helpers.rangeToNumber({ min: 1, max: 100000 })
let EditCustNum = faker.helpers.rangeToNumber({ min: 1, max: 100000 })
const LegalName = 'LegalCustm' + NewCustNum
const BrandName = 'BrandPartner' + NewCustNum
const Internalref = 'IRP' + NewCustNum
const InternalrefLowercase = Internalref.toLowerCase()
const contactemail = faker.internet.email()
const EditLegalName = 'LegalCustm' + EditCustNum
const EditBrandName = 'BrandPartner' + EditCustNum
const Editcontactemail = faker.internet.email()
const loginPage = new LoginPage()
const CustPage = new CustomerPage()
let data
describe('Customer Page - Partner', () => {
beforeEach(() => {
cy.fixture('login').then((loginData) => {
data = loginData
cy.clearCookies()
cy.clearLocalStorage()
cy.login(data.UserName, data.Password)
})
})
it('Click on customer icon & verify headers', () => {
cy.log('Running')
CustPage.UAM_Page().click()
CustPage.CustomerIcon().should('be.visible')
CustPage.CustomerIcon().click()
CustPage.NewCustomerButton().should('be.visible')
CustPage.BrandNameHeader().should('be.visible')
CustPage.LegalNameHeader().should('be.visible')
CustPage.ContactEmailHeader().should('be.visible')
CustPage.InternalRefHeader().should('be.visible')
CustPage.CreationDateHeader().should('be.visible')
})
it('Verify cancel Button & save Empty Form', () => {
CustPage.UAM_Page().click()
CustPage.CustomerIcon().should('be.visible')
CustPage.CustomerIcon().click()
CustPage.NewCustomerButton().should('be.visible')
CustPage.NewCustomerButton().click()
CustPage.CustomerFormHeader().should('be.visible')
//Click on cancel button & verify
CustPage.CancelButton().click()
CustPage.CustomerFormHeader().should("not.exist")
//Save Empty form it should not work
CustPage.NewCustomerButton().click()
CustPage.AddNewCustomerButton().click()
CustPage.EmptyLegalMessage().should('be.visible')
CustPage.EmptyBrandMessage().should('be.visible')
CustPage.EmptyEmailMessage().should('be.visible')
CustPage.EmptyIntRefMessage().should('be.visible')
//Click on save it should not save
CustPage.AddNewCustomerButton().click()
CustPage.CustomerCreated_Message().should('not.exist')
CustPage.CancelButton().click()
})
afterEach(() => {
CustPage.MenuContainer().click()
CustPage.Logout().click()
})
})
@EashBhanu-CCD
Thank you for sharing your test spec. I don't think it will be possible to help you here as a GitHub Action issue.
You have a problem with your Application under Test and Cypress working together. Your Cypress test is also using modules from your application to run, so it is not enough to just see the contents of the test spec in order to understand what is happening.
If you can reduce your problem to a simple example which does not work, then perhaps the Discord community will be able to help you.
Sorry that I can't help you anymore on this issue.
@MikeMcC399 In short answer its not able to click the below element in github action even though i have given timeout of 60000ms : //button[@type='button'][normalize-space()='New customer']
@EashBhanu-CCD
I suggest to close this issue as the problem is not caused by cypress-io/github-action
.
You can continue to request assistance in your Discord thread.
are fix solved your problem @EashBhanu-CCD ?
Version
Error in Github action its not able to click button but it always pass in local
1) Customer Page - Partner Click on customer icon & verify headers: AssertionError: Timed out retrying after 60000ms: Expected to find element:
//button[@type='button'][normalize-space()='New customer'], but never found it. at Context.eval (webpack://csc-external-ui-automation/./cypress/e2e/Customer.cy.js:44:33)