-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
return GUI data for selected endpoint and not just the first one in the list #1520
Changes from 8 commits
09932a6
98ef23a
b6fbd78
fde272a
f1f8ab5
120da8f
cecbae0
b3174e1
3eda6eb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
/// <reference types="cypress" /> | ||
|
||
Cypress.on('uncaught:exception', (err, runnable) => { | ||
// returning false here prevents Cypress from failing the test | ||
return false | ||
}) | ||
|
||
describe('Add multiple clusters and search', () => { | ||
// This will hold the fixture data and the flag for skipping the tests | ||
let skipTest = false | ||
|
||
before(function () { | ||
// Load the fixture data before running any tests | ||
cy.fixture('data').then((data) => { | ||
this.data = data | ||
// If mode is "matter", set skipTest flag to true | ||
if (this.data.mode === 'matter') { | ||
skipTest = true | ||
} | ||
}) | ||
}) | ||
|
||
it('create two endpoints and validate basic information', function () { | ||
// Skip the test if the flag is true (mode is "matter") | ||
if (skipTest) { | ||
cy.log('Skipping test because mode is "matter"') | ||
return // Skip the test if mode is 'matter' | ||
} | ||
|
||
// Continue with the test if the mode is not "matter" | ||
cy.fixture('baseurl').then((data) => { | ||
cy.visit(data.baseurl) | ||
}) | ||
cy.setZclProperties() | ||
|
||
// Create and validate the first endpoint | ||
cy.fixture('data').then((data) => { | ||
cy.addEndpoint(data.endpoint4, data.cluster1) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I do not understand this as I am not familiar with what is happening here. Comment says first endpoint and There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes, this is just how cypress is setup for all tests but I agree it should be fixed and cleaned up. I will work on a follow up PR to fix Cypress in general |
||
}) | ||
cy.get('.flex > strong').should('contain', '#1') | ||
|
||
// Select the "Power Configuration" cluster for the second endpoint | ||
paulr34 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
cy.fixture('data').then((data) => { | ||
cy.gotoAttributePage(data.endpoint1, data.cluster1) | ||
cy.contains('.q-item__section .q-item__label', 'General', { | ||
timeout: 10000 | ||
}) | ||
.should('be.visible') | ||
.click() | ||
}) | ||
|
||
// Check the "Attribute Reporting" tab for the second endpoint | ||
cy.fixture('data').then((data) => { | ||
cy.contains('.q-tab__content .q-tab__label', 'Attribute Reporting', { | ||
timeout: 10000 | ||
}) | ||
.should('be.visible') | ||
.click() | ||
}) | ||
cy.get( | ||
'.q-virtual-scroll__content > :nth-child(1) > :nth-child(2) > .q-toggle > .q-toggle__inner > .q-toggle__thumb' | ||
).click() | ||
// Check to make sure the button is still visible after clicking | ||
cy.get( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I hope this test does not just get the next item in the list. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm sorry I'm confused what you mean here There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I just don't really know how this checks in the UI when an attribute vanishes. If there are 2 attributes in the attribute reporting and one of them vanishes then does the second one just show up in the first one's place and pass this test? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see, it gets a specific one There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It doesn't just get the first one in the list but I will triple check |
||
'.q-virtual-scroll__content > :nth-child(1) > :nth-child(2) > .q-toggle > .q-toggle__inner > .q-toggle__thumb' | ||
).should('be.visible') | ||
}) | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better to run it for zigbee than not matter. If a new protocol does not have attribute reporting then this test will fail.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure good idea
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done, thank you