add test to search asset by qr and serial number #6266
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
WHAT
🤖 Generated by Copilot at 16b0bd8
This pull request improves the cypress tests for the asset homepage and search features. It refactors the login process, adds more fields and validations to the asset search test, and enhances the
AssetSearchPage
class with new methods and assertions.Proposed Changes
@coronasafe/care-fe-code-reviewers @coronasafe/code-reviewers
Merge Checklist
HOW
🤖 Generated by Copilot at 16b0bd8
LoginPage
class fromLogin
page object module to use its methods for logging in as different types of users (link)cy.loginByApi
method withloginPage.loginAsDistrictAdmin
method to log in as a district admin user through the UI instead of using the API (link)asset_homepage.cy.ts
file (link)typeSearchKeyword
method inAssetSearchPage
class to clear the search input field before typing the keyword, and use#search
selector instead of[name='search']
selector (link)clickAssetByName
andverifyBadgeContent
methods toAssetSearchPage
class to click on an asset with the given name from the asset list, and assert that the badge element has the expected text (link)clickUpdateButton
,clearAndTypeQRCode
,clearAndTypeSerialNumber
,clickAssetSubmitButton
,visitAssetsPage
, andverifyAssetListContains
methods toAssetSearchPage
class to update the QR ID and serial number of an asset, and verify the changes in the asset list (link)