Skip to content

Commit d675e82

Browse files
committed
test(page-context): add UI validation for Ask AI widget configuration
- Added 4 tests checking Kapa widget script data attributes - Tests verify data-modal-example-questions contains correct product-specific questions - Validates Explorer, Core, Enterprise, and Enterprise v1 configurations - All 31 tests passing (27 existing + 4 new UI tests)
1 parent c2a49b1 commit d675e82

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed

cypress/e2e/page-context.cy.js

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,60 @@ describe('Page Context - Product Mapping', function () {
113113
});
114114
});
115115

116+
describe('Ask AI Widget Configuration', function () {
117+
describe('InfluxDB 3 Products', function () {
118+
it('should configure Explorer-specific questions in Kapa widget', function () {
119+
cy.visit('/influxdb3/explorer/');
120+
121+
// Check the Kapa widget script tag has correct data-modal-example-questions attribute
122+
cy.get('script[src*="kapa-widget.bundle.js"]').should(($script) => {
123+
const questions = $script.attr('data-modal-example-questions');
124+
expect(questions).to.include('install and run Explorer');
125+
expect(questions).to.include('query data using Explorer');
126+
expect(questions).to.include('visualize data using Explorer');
127+
// Should NOT have Core/Enterprise specific questions
128+
expect(questions).to.not.include('plugin');
129+
expect(questions).to.not.include('read replica');
130+
});
131+
});
132+
133+
it('should configure Core-specific questions in Kapa widget', function () {
134+
cy.visit('/influxdb3/core/');
135+
136+
cy.get('script[src*="kapa-widget.bundle.js"]').should(($script) => {
137+
const questions = $script.attr('data-modal-example-questions');
138+
expect(questions).to.include('install and run');
139+
expect(questions).to.include('plugin for the Python Processing engine');
140+
// Should NOT have read replica question
141+
expect(questions).to.not.include('read replica');
142+
});
143+
});
144+
145+
it('should configure Enterprise-specific questions in Kapa widget', function () {
146+
cy.visit('/influxdb3/enterprise/');
147+
148+
cy.get('script[src*="kapa-widget.bundle.js"]').should(($script) => {
149+
const questions = $script.attr('data-modal-example-questions');
150+
expect(questions).to.include('install and run');
151+
expect(questions).to.include('read replica node');
152+
});
153+
});
154+
});
155+
156+
describe('InfluxDB v1 Products', function () {
157+
it('should configure Enterprise v1-specific questions in Kapa widget', function () {
158+
cy.visit('/enterprise_influxdb/v1/');
159+
160+
cy.get('script[src*="kapa-widget.bundle.js"]').should(($script) => {
161+
const questions = $script.attr('data-modal-example-questions');
162+
expect(questions).to.include('configure the server');
163+
expect(questions).to.include('replicate data from OSS');
164+
expect(questions).to.include('query data');
165+
});
166+
});
167+
});
168+
});
169+
116170
describe('Product Data Validation - AI Questions', function () {
117171
describe('InfluxDB 3 Products', function () {
118172
it('should have correct Explorer AI configuration', function () {

0 commit comments

Comments
 (0)