|
2 | 2 |
|
3 | 3 | /** |
4 | 4 | * Page Context E2E Test Suite |
| 5 | + * Tests that all products in products.yml are correctly mapped in page-context.js |
5 | 6 | */ |
6 | 7 |
|
7 | | -describe('Page Context - Ask AI Integration', function () { |
8 | | - describe('Explorer Product Mapping', function () { |
9 | | - it('should show Explorer-specific Ask AI questions', function () { |
| 8 | +describe('Page Context - Product Mapping', function () { |
| 9 | + describe('InfluxDB 3 Products', function () { |
| 10 | + it('should map Explorer pages correctly', function () { |
10 | 11 | cy.visit('/influxdb3/explorer/'); |
11 | | - |
12 | | - // Wait for page to load |
13 | 12 | cy.get('body').should('be.visible'); |
14 | | - |
15 | | - // The Ask AI widget should eventually be initialized |
16 | | - // We can't easily test the Kapa widget directly in Cypress, |
17 | | - // but we can verify the page loaded correctly for Explorer |
18 | 13 | cy.url().should('include', '/influxdb3/explorer/'); |
19 | | - |
20 | | - // Verify the page has the expected title |
21 | 14 | cy.get('h1').should('contain', 'InfluxDB 3 Explorer'); |
22 | 15 | }); |
23 | 16 |
|
24 | | - it('should show Core-specific content', function () { |
| 17 | + it('should map Core pages correctly', function () { |
25 | 18 | cy.visit('/influxdb3/core/'); |
26 | | - |
27 | 19 | cy.get('body').should('be.visible'); |
28 | 20 | cy.url().should('include', '/influxdb3/core/'); |
29 | 21 | cy.get('h1').should('contain', 'InfluxDB 3 Core'); |
30 | 22 | }); |
31 | 23 |
|
32 | | - it('should show Enterprise-specific content', function () { |
| 24 | + it('should map Enterprise pages correctly', function () { |
33 | 25 | cy.visit('/influxdb3/enterprise/'); |
34 | | - |
35 | 26 | cy.get('body').should('be.visible'); |
36 | 27 | cy.url().should('include', '/influxdb3/enterprise/'); |
37 | 28 | cy.get('h1').should('contain', 'InfluxDB 3 Enterprise'); |
38 | 29 | }); |
| 30 | + |
| 31 | + it('should map Cloud Serverless pages correctly', function () { |
| 32 | + cy.visit('/influxdb3/cloud-serverless/'); |
| 33 | + cy.get('body').should('be.visible'); |
| 34 | + cy.url().should('include', '/influxdb3/cloud-serverless/'); |
| 35 | + cy.get('h1').should('contain', 'InfluxDB Cloud Serverless'); |
| 36 | + }); |
| 37 | + |
| 38 | + it('should map Cloud Dedicated pages correctly', function () { |
| 39 | + cy.visit('/influxdb3/cloud-dedicated/'); |
| 40 | + cy.get('body').should('be.visible'); |
| 41 | + cy.url().should('include', '/influxdb3/cloud-dedicated/'); |
| 42 | + cy.get('h1').should('contain', 'InfluxDB Cloud Dedicated'); |
| 43 | + }); |
| 44 | + |
| 45 | + it('should map Clustered pages correctly', function () { |
| 46 | + cy.visit('/influxdb3/clustered/'); |
| 47 | + cy.get('body').should('be.visible'); |
| 48 | + cy.url().should('include', '/influxdb3/clustered/'); |
| 49 | + cy.get('h1').should('contain', 'InfluxDB Clustered'); |
| 50 | + }); |
39 | 51 | }); |
40 | 52 |
|
41 | | - describe('Product Data Validation', function () { |
42 | | - it('should have correct Explorer product configuration', function () { |
| 53 | + describe('InfluxDB v2 and Cloud Products', function () { |
| 54 | + it('should map InfluxDB v2 pages correctly', function () { |
| 55 | + cy.visit('/influxdb/v2/'); |
| 56 | + cy.get('body').should('be.visible'); |
| 57 | + cy.url().should('include', '/influxdb/v2/'); |
| 58 | + cy.get('h1').should('contain', 'InfluxDB v2'); |
| 59 | + }); |
| 60 | + |
| 61 | + it('should map InfluxDB Cloud (TSM) pages correctly', function () { |
| 62 | + cy.visit('/influxdb/cloud/'); |
| 63 | + cy.get('body').should('be.visible'); |
| 64 | + cy.url().should('include', '/influxdb/cloud/'); |
| 65 | + cy.get('h1').should('contain', 'InfluxDB Cloud'); |
| 66 | + }); |
| 67 | + }); |
| 68 | + |
| 69 | + describe('InfluxDB v1 Products', function () { |
| 70 | + it('should map InfluxDB v1 pages correctly', function () { |
| 71 | + cy.visit('/influxdb/v1/'); |
| 72 | + cy.get('body').should('be.visible'); |
| 73 | + cy.url().should('include', '/influxdb/v1/'); |
| 74 | + cy.get('h1').should('contain', 'InfluxDB OSS'); |
| 75 | + }); |
| 76 | + |
| 77 | + it('should map Enterprise v1 pages correctly', function () { |
| 78 | + cy.visit('/enterprise_influxdb/v1/'); |
| 79 | + cy.get('body').should('be.visible'); |
| 80 | + cy.url().should('include', '/enterprise_influxdb/v1/'); |
| 81 | + cy.get('h1').should('contain', 'InfluxDB Enterprise'); |
| 82 | + }); |
| 83 | + }); |
| 84 | + |
| 85 | + describe('Other Products', function () { |
| 86 | + it('should map Telegraf pages correctly', function () { |
| 87 | + cy.visit('/telegraf/v1/'); |
| 88 | + cy.get('body').should('be.visible'); |
| 89 | + cy.url().should('include', '/telegraf/v1/'); |
| 90 | + cy.get('h1').should('contain', 'Telegraf'); |
| 91 | + }); |
| 92 | + |
| 93 | + it('should map Chronograf pages correctly', function () { |
| 94 | + cy.visit('/chronograf/v1/'); |
| 95 | + cy.get('body').should('be.visible'); |
| 96 | + cy.url().should('include', '/chronograf/v1/'); |
| 97 | + cy.get('h1').should('contain', 'Chronograf'); |
| 98 | + }); |
| 99 | + |
| 100 | + it('should map Kapacitor pages correctly', function () { |
| 101 | + cy.visit('/kapacitor/v1/'); |
| 102 | + cy.get('body').should('be.visible'); |
| 103 | + cy.url().should('include', '/kapacitor/v1/'); |
| 104 | + cy.get('h1').should('contain', 'Kapacitor'); |
| 105 | + }); |
| 106 | + |
| 107 | + it('should map Flux pages correctly', function () { |
| 108 | + cy.visit('/flux/v0/'); |
| 109 | + cy.get('body').should('be.visible'); |
| 110 | + cy.url().should('include', '/flux/v0/'); |
| 111 | + cy.get('h1').should('contain', 'Flux'); |
| 112 | + }); |
| 113 | + }); |
| 114 | +}); |
| 115 | + |
| 116 | +describe('Product Data Validation - AI Questions', function () { |
| 117 | + describe('InfluxDB 3 Products', function () { |
| 118 | + it('should have correct Explorer AI configuration', function () { |
43 | 119 | cy.task('getData', 'products').then((products) => { |
44 | | - // Verify Explorer product exists in products.yml |
45 | 120 | expect(products.influxdb3_explorer).to.exist; |
46 | 121 | expect(products.influxdb3_explorer.name).to.equal( |
47 | 122 | 'InfluxDB 3 Explorer' |
48 | 123 | ); |
49 | | - expect(products.influxdb3_explorer.namespace).to.equal( |
50 | | - 'influxdb3_explorer' |
51 | | - ); |
52 | | - expect(products.influxdb3_explorer.placeholder_host).to.equal( |
53 | | - 'localhost:8888' |
54 | | - ); |
55 | | - |
56 | | - // Verify AI configuration |
57 | 124 | expect(products.influxdb3_explorer.ai_sample_questions).to.exist; |
58 | 125 | expect(products.influxdb3_explorer.ai_sample_questions).to.be.an( |
59 | 126 | 'array' |
60 | 127 | ); |
61 | | - expect( |
62 | | - products.influxdb3_explorer.ai_sample_questions.length |
63 | | - ).to.be.greaterThan(0); |
64 | 128 |
|
65 | | - // Verify Explorer-specific questions |
66 | 129 | const questionsText = |
67 | 130 | products.influxdb3_explorer.ai_sample_questions.join(' '); |
68 | 131 | expect(questionsText).to.include('install and run'); |
69 | 132 | expect(questionsText).to.include('query data'); |
70 | 133 | expect(questionsText).to.include('visualize data'); |
71 | | - |
72 | | - // Verify it doesn't have Core/Enterprise specific questions |
73 | 134 | expect(questionsText).to.not.include('plugin'); |
74 | 135 | expect(questionsText).to.not.include('read replica'); |
75 | 136 | }); |
76 | 137 | }); |
77 | 138 |
|
78 | | - it('should have correct Core product configuration', function () { |
| 139 | + it('should have correct Core AI configuration', function () { |
79 | 140 | cy.task('getData', 'products').then((products) => { |
80 | 141 | expect(products.influxdb3_core).to.exist; |
81 | 142 | expect(products.influxdb3_core.name).to.equal('InfluxDB 3 Core'); |
82 | | - expect(products.influxdb3_core.placeholder_host).to.equal( |
83 | | - 'localhost:8181' |
84 | | - ); |
| 143 | + expect(products.influxdb3_core.ai_sample_questions).to.exist; |
85 | 144 |
|
86 | 145 | const questionsText = |
87 | 146 | products.influxdb3_core.ai_sample_questions.join(' '); |
88 | 147 | expect(questionsText).to.include('install and run'); |
89 | 148 | expect(questionsText).to.include('plugin'); |
| 149 | + expect(questionsText).to.not.include('read replica'); |
90 | 150 | }); |
91 | 151 | }); |
92 | 152 |
|
93 | | - it('should have correct Enterprise product configuration', function () { |
| 153 | + it('should have correct Enterprise AI configuration', function () { |
94 | 154 | cy.task('getData', 'products').then((products) => { |
95 | 155 | expect(products.influxdb3_enterprise).to.exist; |
96 | 156 | expect(products.influxdb3_enterprise.name).to.equal( |
97 | 157 | 'InfluxDB 3 Enterprise' |
98 | 158 | ); |
99 | | - expect(products.influxdb3_enterprise.placeholder_host).to.equal( |
100 | | - 'localhost:8181' |
101 | | - ); |
| 159 | + expect(products.influxdb3_enterprise.ai_sample_questions).to.exist; |
102 | 160 |
|
103 | 161 | const questionsText = |
104 | 162 | products.influxdb3_enterprise.ai_sample_questions.join(' '); |
105 | 163 | expect(questionsText).to.include('install and run'); |
106 | 164 | expect(questionsText).to.include('read replica'); |
107 | 165 | }); |
108 | 166 | }); |
| 167 | + |
| 168 | + it('should have correct Cloud Serverless AI configuration', function () { |
| 169 | + cy.task('getData', 'products').then((products) => { |
| 170 | + expect(products.influxdb3_cloud_serverless).to.exist; |
| 171 | + expect(products.influxdb3_cloud_serverless.name).to.equal( |
| 172 | + 'InfluxDB Cloud Serverless' |
| 173 | + ); |
| 174 | + expect( |
| 175 | + products.influxdb3_cloud_serverless.ai_sample_questions |
| 176 | + ).to.exist; |
| 177 | + |
| 178 | + const questionsText = |
| 179 | + products.influxdb3_cloud_serverless.ai_sample_questions.join(' '); |
| 180 | + expect(questionsText).to.include('migrate from Cloud'); |
| 181 | + expect(questionsText).to.include('write data'); |
| 182 | + }); |
| 183 | + }); |
| 184 | + |
| 185 | + it('should have correct Cloud Dedicated AI configuration', function () { |
| 186 | + cy.task('getData', 'products').then((products) => { |
| 187 | + expect(products.influxdb3_cloud_dedicated).to.exist; |
| 188 | + expect(products.influxdb3_cloud_dedicated.name).to.equal( |
| 189 | + 'InfluxDB Cloud Dedicated' |
| 190 | + ); |
| 191 | + expect(products.influxdb3_cloud_dedicated.ai_sample_questions).to.exist; |
| 192 | + |
| 193 | + const questionsText = |
| 194 | + products.influxdb3_cloud_dedicated.ai_sample_questions.join(' '); |
| 195 | + expect(questionsText).to.include('migrate from v1'); |
| 196 | + expect(questionsText).to.include('SQL'); |
| 197 | + }); |
| 198 | + }); |
| 199 | + |
| 200 | + it('should have correct Clustered AI configuration', function () { |
| 201 | + cy.task('getData', 'products').then((products) => { |
| 202 | + expect(products.influxdb3_clustered).to.exist; |
| 203 | + expect(products.influxdb3_clustered.name).to.equal( |
| 204 | + 'InfluxDB Clustered' |
| 205 | + ); |
| 206 | + expect(products.influxdb3_clustered.ai_sample_questions).to.exist; |
| 207 | + |
| 208 | + const questionsText = |
| 209 | + products.influxdb3_clustered.ai_sample_questions.join(' '); |
| 210 | + expect(questionsText).to.include('Helm chart'); |
| 211 | + expect(questionsText).to.include('SQL'); |
| 212 | + }); |
| 213 | + }); |
| 214 | + }); |
| 215 | + |
| 216 | + describe('InfluxDB v2 and Cloud Products', function () { |
| 217 | + it('should have correct InfluxDB v2 AI configuration', function () { |
| 218 | + cy.task('getData', 'products').then((products) => { |
| 219 | + expect(products.influxdb).to.exist; |
| 220 | + expect(products.influxdb.name).to.equal('InfluxDB'); |
| 221 | + expect(products.influxdb.ai_sample_questions).to.exist; |
| 222 | + |
| 223 | + const questionsText = products.influxdb.ai_sample_questions.join(' '); |
| 224 | + expect(questionsText).to.include('write and query data'); |
| 225 | + expect(questionsText).to.include('migrate to InfluxDB 3'); |
| 226 | + expect(questionsText).to.include('auth tokens'); |
| 227 | + }); |
| 228 | + }); |
| 229 | + |
| 230 | + it('should have correct Cloud (TSM) AI configuration', function () { |
| 231 | + cy.task('getData', 'products').then((products) => { |
| 232 | + expect(products.influxdb_cloud).to.exist; |
| 233 | + expect(products.influxdb_cloud.name).to.equal('InfluxDB Cloud (TSM)'); |
| 234 | + expect(products.influxdb_cloud.ai_sample_questions).to.exist; |
| 235 | + |
| 236 | + const questionsText = |
| 237 | + products.influxdb_cloud.ai_sample_questions.join(' '); |
| 238 | + expect(questionsText).to.include('write and query data'); |
| 239 | + expect(questionsText).to.include('Cloud (TSM)'); |
| 240 | + }); |
| 241 | + }); |
| 242 | + }); |
| 243 | + |
| 244 | + describe('InfluxDB v1 Products', function () { |
| 245 | + it('should have correct Enterprise v1 AI configuration', function () { |
| 246 | + cy.task('getData', 'products').then((products) => { |
| 247 | + expect(products.enterprise_influxdb).to.exist; |
| 248 | + expect(products.enterprise_influxdb.name).to.equal( |
| 249 | + 'InfluxDB Enterprise v1' |
| 250 | + ); |
| 251 | + expect(products.enterprise_influxdb.ai_sample_questions).to.exist; |
| 252 | + |
| 253 | + const questionsText = |
| 254 | + products.enterprise_influxdb.ai_sample_questions.join(' '); |
| 255 | + expect(questionsText).to.include('configure the server'); |
| 256 | + expect(questionsText).to.include('replicate data'); |
| 257 | + expect(questionsText).to.include('query data'); |
| 258 | + }); |
| 259 | + }); |
| 260 | + }); |
| 261 | + |
| 262 | + describe('Other Products', function () { |
| 263 | + it('should have correct Telegraf AI configuration', function () { |
| 264 | + cy.task('getData', 'products').then((products) => { |
| 265 | + expect(products.telegraf).to.exist; |
| 266 | + expect(products.telegraf.name).to.equal('Telegraf'); |
| 267 | + expect(products.telegraf.ai_sample_questions).to.exist; |
| 268 | + |
| 269 | + const questionsText = products.telegraf.ai_sample_questions.join(' '); |
| 270 | + expect(questionsText).to.include('configure Telegraf'); |
| 271 | + expect(questionsText).to.include('custom'); |
| 272 | + expect(questionsText).to.include('MQTT'); |
| 273 | + }); |
| 274 | + }); |
| 275 | + |
| 276 | + it('should have correct Chronograf AI configuration', function () { |
| 277 | + cy.task('getData', 'products').then((products) => { |
| 278 | + expect(products.chronograf).to.exist; |
| 279 | + expect(products.chronograf.name).to.equal('Chronograf'); |
| 280 | + expect(products.chronograf.ai_sample_questions).to.exist; |
| 281 | + |
| 282 | + const questionsText = products.chronograf.ai_sample_questions.join(' '); |
| 283 | + expect(questionsText).to.include('configure Chronograf'); |
| 284 | + expect(questionsText).to.include('dashboard'); |
| 285 | + }); |
| 286 | + }); |
| 287 | + |
| 288 | + it('should have correct Kapacitor AI configuration', function () { |
| 289 | + cy.task('getData', 'products').then((products) => { |
| 290 | + expect(products.kapacitor).to.exist; |
| 291 | + expect(products.kapacitor.name).to.equal('Kapacitor'); |
| 292 | + expect(products.kapacitor.ai_sample_questions).to.exist; |
| 293 | + |
| 294 | + const questionsText = products.kapacitor.ai_sample_questions.join(' '); |
| 295 | + expect(questionsText).to.include('configure Kapacitor'); |
| 296 | + expect(questionsText).to.include('custom task'); |
| 297 | + }); |
| 298 | + }); |
| 299 | + |
| 300 | + it('should have correct Flux AI configuration', function () { |
| 301 | + cy.task('getData', 'products').then((products) => { |
| 302 | + expect(products.flux).to.exist; |
| 303 | + expect(products.flux.name).to.equal('Flux'); |
| 304 | + expect(products.flux.ai_sample_questions).to.exist; |
| 305 | + |
| 306 | + const questionsText = products.flux.ai_sample_questions.join(' '); |
| 307 | + expect(questionsText).to.include('query with Flux'); |
| 308 | + expect(questionsText).to.include('transform data'); |
| 309 | + expect(questionsText).to.include('join data'); |
| 310 | + }); |
| 311 | + }); |
109 | 312 | }); |
110 | 313 | }); |
0 commit comments