Skip to content

Commit 069eb24

Browse files
committed
feat: add dark module
Signed-off-by: zhaoxinxin <1186037180@qq.com>
1 parent a571504 commit 069eb24

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+376
-286
lines changed

cypress/e2e/clusters/cluster.cy.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -214,11 +214,11 @@ describe('Cluster', () => {
214214
// Click the copy scheduler cluster id icon.
215215
cy.get('#copy-scheduler-cluster-id').click();
216216
cy.get('#schedulerClusterIDCopyIcon').should('exist');
217-
cy.get('#schedulerClusterIDTooltip').should('exist');
217+
cy.get('#schedulerClusterIDTooltip').should('not.exist');
218218
cy.wait(1000);
219219

220220
// Display successful copy icon.
221-
cy.get('#schedulerClusterIDCopyIcon').should('not.exist');
221+
cy.get('#schedulerClusterIDCopyIcon').should('exist');
222222
cy.get('#schedulerClusterIDTooltip').should('not.exist');
223223

224224
// Let's check the copied text.
@@ -230,11 +230,11 @@ describe('Cluster', () => {
230230
// Click the copy seed peer cluster id icon.
231231
cy.get('#copy-seed-peer-cluster-id').click();
232232
cy.get('#seedPeerClusterIDCopyIcon').should('exist');
233-
cy.get('#seedPeerClusterIDTooltip').should('exist');
233+
cy.get('#seedPeerClusterIDTooltip').should('not.exist');
234234
cy.wait(1000);
235235

236236
// Display successful copy icon.
237-
cy.get('#seedPeerClusterIDCopyIcon').should('not.exist');
237+
cy.get('#seedPeerClusterIDCopyIcon').should('exist');
238238
cy.get('#seedPeerClusterIDTooltip').should('not.exist');
239239

240240
// Let's check the copied text.

cypress/e2e/clusters/clusters.cy.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ describe('Clusters', () => {
268268

269269
cy.get('#clusterPagination > .MuiPagination-ul .Mui-selected').should('have.text', '5');
270270

271-
cy.get('#clusters').children().should('have.length', 1);
271+
cy.get('#clustersCard').children().should('have.length', 1);
272272

273273
cy.get('#cluster-name-37').should('have.text', 'cluster-37');
274274

@@ -384,7 +384,7 @@ describe('Clusters', () => {
384384
cy.get('#free-solo-demo').type('cluster-47');
385385

386386
// No clusters card.
387-
cy.get('#clusters').should('not.exist');
387+
cy.get('#clustersCard').should('not.exist');
388388

389389
// Pagination has been hidden.
390390
cy.get('#clusterPagination > .MuiPagination-ul').should('not.exist');

cypress/e2e/developer/tokens/create-token.cy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ describe('Create token', () => {
2727
cy.visit('/developer/personal-access-tokens');
2828

2929
// Click the `ADD PERSONAL ACCESS TOKENS` button.
30-
cy.get('.css-1qdyvok > .MuiButtonBase-root').click();
30+
cy.get('#new-tokens-button').click();
3131

3232
// Then I see that the current page is the developer/personal-access-tokens/new!
3333
cy.url().should('include', '/developer/personal-access-tokens/new');

cypress/e2e/developer/tokens/tokens.cy.ts

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,7 @@ describe('Tokens', () => {
2525

2626
it('when data is loaded', () => {
2727
cy.get('[data-testid="isloading"]').should('be.exist');
28-
cy.get('.css-1qdyvok > .MuiTypography-root').should('have.text', 'Personal access tokens');
29-
30-
cy.get('.MuiList-root > :nth-child(2) > .MuiButtonBase-root > .MuiTypography-root').click();
31-
32-
// Whether the style selected by menu is Personal access tokens.
33-
cy.get('.MuiCollapse-wrapperInner > .MuiList-root > .MuiButtonBase-root').should('have.class', 'Mui-selected');
28+
cy.get('#token-title').should('have.text', 'Personal access tokens');
3429

3530
// Show token name.
3631
cy.get('#root-11').should('be.visible').and('have.text', 'root-11');
@@ -120,9 +115,9 @@ describe('Tokens', () => {
120115
cy.get('#tokens-pagination > .MuiPagination-ul .Mui-selected').should('have.text', '2');
121116

122117
// Show token name.
123-
cy.get('.MuiTypography-inherit').should('be.visible').and('have.text', 'root-1');
118+
cy.get('#root-1').should('be.visible').and('have.text', 'root-1');
124119

125-
cy.get('span.css-189ppmh-MuiTypography-root').should('be.visible').and('have.text', 'Thu, Dec 1 2033.');
120+
cy.get('#expired-at-1').should('be.visible').and('have.text', 'Thu, Dec 1 2033.');
126121
});
127122

128123
it('when you click refresh, the paginated results and page numbers remain unchanged.', () => {

cypress/e2e/job/preheats/create-preheat.cy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ describe('Create preheat', () => {
4646

4747
it('can create preheat', () => {
4848
cy.visit('/jobs/preheats');
49-
cy.get('.css-1g5t85q > .MuiButtonBase-root').click();
49+
cy.get('#new-preheat').click();
5050

5151
cy.url().should('include', '/jobs/preheats/new');
5252

cypress/e2e/job/preheats/preheat.cy.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,14 @@ describe('Preheat', () => {
4444
it('click the breadcrumb', () => {
4545
cy.get('[data-testid="isloading"]').should('be.exist');
4646

47-
cy.get(':nth-child(6) > .css-1mlhis1 > .css-1ozvesn > .MuiTypography-root > .MuiBox-root').click();
47+
cy.get('#preheat-6').click();
4848

4949
cy.url().should('include', '/jobs/preheats/6');
5050

5151
// Check for breadcrumb.
52-
cy.get('.MuiBreadcrumbs-ol > :nth-child(3) > .MuiTypography-root').should('exist').and('contain', 'preheats');
52+
cy.get(':nth-child(3) > .MuiTypography-root').should('exist').and('contain', 'Preheat');
5353

54-
cy.get('.MuiBreadcrumbs-ol > :nth-child(3) > .MuiTypography-root').click();
54+
cy.get(':nth-child(3) > .MuiTypography-root').click();
5555

5656
cy.get('[data-testid="isloading"]').should('not.exist');
5757

@@ -244,7 +244,7 @@ describe('Preheat', () => {
244244
});
245245

246246
it('unable to display breadcrumb', () => {
247-
cy.get('.MuiBreadcrumbs-ol').should('be.visible').and('contain', 'preheats');
247+
cy.get('.MuiBreadcrumbs-ol').should('be.visible').and('contain', 'Preheat');
248248

249249
cy.get('.MuiBreadcrumbs-ol > :nth-child(5) > .MuiTypography-root').should('have.text', '-');
250250
});
@@ -303,7 +303,7 @@ describe('Preheat', () => {
303303
});
304304

305305
it('unable to display breadcrumb', () => {
306-
cy.get('.MuiBreadcrumbs-ol').should('be.visible').and('contain', 'preheats');
306+
cy.get('.MuiBreadcrumbs-ol').should('be.visible').and('contain', 'Preheat');
307307

308308
cy.get('.MuiBreadcrumbs-ol > :nth-child(5) > .MuiTypography-root').should('have.text', '-');
309309
});

cypress/e2e/job/preheats/preheats.cy.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,30 +67,32 @@ describe('Preheats', () => {
6767
).as('preheats');
6868
cy.get('[data-testid="isloading"]').should('be.exist');
6969
cy.wait(120000);
70+
7071
// Executed every 3 seconds, it should be executed 2 times after 6 seconds.
7172
cy.get('@preheats').then(() => {
7273
expect(interceptCount).to.be.greaterThan(0);
7374
expect(interceptCount).to.be.closeTo(2, 1);
7475
});
76+
7577
cy.get('[data-testid="isloading"]').should('not.exist');
7678
cy.get('.MuiList-root > :nth-child(3) > .MuiButtonBase-root').click();
77-
// Whether the style selected by menu is Preheat.
78-
cy.get(
79-
':nth-child(3) > .MuiCollapse-root > .MuiCollapse-wrapper > .MuiCollapse-wrapperInner > .MuiList-root > .MuiButtonBase-root',
80-
).should('have.class', 'Mui-selected');
81-
cy.get('.css-1g5t85q > .MuiTypography-root').should('be.visible').and('have.text', 'Preheats');
79+
8280
// The preheating status is displayed as PENDING.
8381
cy.get('#PENDING-11').should('exist');
8482
cy.get('#id-11').should('have.text', 11);
83+
8584
// cy.get('#created_at-11').should('have.text', '2023-03-23 16:29:18');
8685
cy.get('#description-11').should('have.text', 'This is a preheat task with status pending');
86+
8787
// The preheating status is displayed as FAILURE.
8888
cy.get('#FAILURE-10').should('exist');
8989
cy.get('#description-10').should('have.text', 'This is a preheat task with status failure');
90+
9091
// The preheating status is displayed as SUCCESS.
9192
cy.get('#list-8 > .css-1mlhis1').should('exist').find('#SUCCESS-8').should('exist');
9293
cy.get('#description-8').should('have.text', 'This is a preheat task with status success');
9394
});
95+
9496
it('should display preheat success list', () => {
9597
cy.intercept(
9698
{
@@ -113,6 +115,7 @@ describe('Preheats', () => {
113115
cy.get('#preheats-list').children().should('have.length', 6);
114116
cy.get('#preheat-pagination').should('not.exist');
115117
});
118+
116119
it('should display preheat failure list', () => {
117120
cy.intercept(
118121
{
@@ -134,6 +137,7 @@ describe('Preheats', () => {
134137
// Check how many preheat tasks are in success failure.
135138
cy.get('#preheats-list').children().should('have.length', 4);
136139
});
140+
137141
it('should display preheat pending list', () => {
138142
let interceptCount = 0;
139143
cy.intercept(
@@ -288,7 +292,7 @@ describe('Preheats', () => {
288292
cy.get('#list-1').should('exist').find('#SUCCESS-1').should('exist');
289293

290294
// Go to show preheat page.
291-
cy.get('#preheat-1 > .MuiBox-root').click();
295+
cy.get('#preheat-1').click();
292296

293297
// Then I see that the current page is the show update personal-access-tokens.
294298
cy.url().should('include', '/jobs/preheats/1');

cypress/e2e/job/task/execution.cy.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,12 @@ describe('Executions', () => {
4343
// Show isloading.
4444
cy.get('[data-testid="isloading"]').should('be.exist');
4545

46-
cy.get('#execution-9 > .MuiBox-root').click();
46+
cy.get('#execution-9').click();
4747

4848
cy.url().should('include', '/jobs/task/executions/9');
4949

5050
// Check for breadcrumb.
51-
cy.get('.MuiBreadcrumbs-ol').should('exist').and('contain', 'executions').and('contain', '9');
51+
cy.get('.MuiBreadcrumbs-ol').should('exist').and('contain', 'Executions').and('contain', '9');
5252

5353
cy.get('.MuiBreadcrumbs-ol > :nth-child(5) > .MuiTypography-root').click();
5454

cypress/e2e/job/task/executions.cy.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -84,13 +84,6 @@ describe('Executions', () => {
8484

8585
cy.get('.MuiList-root > :nth-child(3) > .MuiButtonBase-root').click();
8686

87-
// Whether the style selected by menu is Task.
88-
cy.get(
89-
':nth-child(3) > .MuiCollapse-root > .MuiCollapse-wrapper > .MuiCollapse-wrapperInner > .MuiList-root > .MuiButtonBase-root',
90-
).should('have.class', 'Mui-selected');
91-
92-
cy.get('.MuiList-root > .Mui-selected').should('be.visible').and('have.text', 'Task');
93-
9487
// The executions status is displayed as PENDING.
9588
cy.get('#list-11 > .css-1mlhis1').should('exist').find('#PENDING-11').should('exist');
9689
cy.get('#id-11').should('have.text', 11);
@@ -318,7 +311,7 @@ describe('Executions', () => {
318311
cy.get('#list-1').should('exist').find('#SUCCESS-1').should('exist');
319312

320313
// Go to show executions page.
321-
cy.get('#execution-1 > .MuiBox-root').click();
314+
cy.get('#execution-1').click();
322315

323316
// Then I see that the current page is the show update personal-access-tokens.
324317
cy.url().should('include', '/jobs/task/executions/1');

cypress/e2e/menu/menu.cy.ts

Lines changed: 62 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -32,32 +32,36 @@ describe('Menu', () => {
3232
});
3333

3434
it('should navigate to the tokens page', () => {
35-
cy.get('.MuiList-root > :nth-child(2) > .MuiButtonBase-root').click();
36-
cy.get('.MuiCollapse-wrapperInner > .MuiList-root > .MuiButtonBase-root').click();
35+
cy.get('#developer').click();
36+
cy.get('#personal-access-tokens').click();
3737

3838
// Then I see that the current page is the tokens!
3939
cy.url().should('include', '/developer/personal-access-tokens');
4040

4141
// The selected menu is tokens.
42-
cy.get('.MuiCollapse-wrapperInner > .MuiList-root > .MuiButtonBase-root').should('have.class', 'Mui-selected');
42+
cy.get('#personal-access-tokens').should('have.class', 'Mui-selected');
43+
44+
cy.get('#dragonfly').click();
45+
// Then I see that the current page is the clusters!
46+
cy.url().should('include', '/clusters');
4347
});
4448

4549
it('should navigate to the preheats page and task page', () => {
46-
cy.get('.MuiList-root > :nth-child(3) > .MuiButtonBase-root').click();
47-
cy.get('[href="/jobs/preheats"]').click();
50+
cy.get('#jobs').click();
51+
cy.get('#preheats').click();
4852

4953
// Then I see that the current page is the preheats!
5054
cy.url().should('include', '/jobs/preheats');
5155

5256
// The selected menu is preheats.
53-
cy.get('[href="/jobs/preheats"]').should('have.class', 'Mui-selected');
57+
cy.get('#preheats').should('have.class', 'Mui-selected');
5458

55-
cy.get('[href="/jobs/task/clear"]').click();
59+
cy.get('#task').click();
5660

5761
// Then I see that the current page is the task!
5862
cy.url().should('include', '/jobs/task/clear');
5963

60-
cy.get('[href="/jobs/task/clear"]').should('have.class', 'Mui-selected');
64+
cy.get('#task').should('have.class', 'Mui-selected');
6165
});
6266
});
6367

@@ -114,46 +118,42 @@ describe('Menu', () => {
114118
});
115119

116120
it('should navigate to the tokens page', () => {
117-
cy.get('.MuiList-root > :nth-child(2) > .MuiButtonBase-root').click();
118-
cy.get('.MuiCollapse-wrapperInner > .MuiList-root > .MuiButtonBase-root').click();
121+
cy.get('#developer').click();
122+
cy.get('#personal-access-tokens').click();
119123

120124
// Then I see that the current page is the tokens!
121125
cy.url().should('include', '/developer/personal-access-tokens');
122126

123127
// The selected menu is tokens.
124-
cy.get('.MuiCollapse-wrapperInner > .MuiList-root > .MuiButtonBase-root').should('have.class', 'Mui-selected');
128+
cy.get('#personal-access-tokens').should('have.class', 'Mui-selected');
125129
});
126130

127131
it('should navigate to the preheats page and task page', () => {
128-
cy.get('.MuiList-root > :nth-child(3) > .MuiButtonBase-root').click();
129-
cy.get('[href="/jobs/preheats"]').click();
130-
131-
// Show page loading.
132-
cy.get('#page-loading').should('be.visible');
132+
cy.get('#jobs').click();
133+
cy.get('#preheats').click();
133134

134135
// Then I see that the current page is the preheats!
135136
cy.url().should('include', '/jobs/preheats');
136137

137138
// The selected menu is preheats.
138-
cy.get('[href="/jobs/preheats"]').should('have.class', 'Mui-selected');
139+
cy.get('#preheats').should('have.class', 'Mui-selected');
139140

140-
cy.get('[href="/jobs/task/clear"]').click();
141+
cy.get('#task').click();
141142

142143
// Then I see that the current page is the task!
143144
cy.url().should('include', '/jobs/task/clear');
144145

145-
// The selected menu is task.
146-
cy.get('[href="/jobs/task/clear"]').should('have.class', 'Mui-selected');
146+
cy.get('#task').should('have.class', 'Mui-selected');
147147
});
148148

149149
it('should navigate to the users page', () => {
150-
cy.get('[href="/users"]').click();
150+
cy.get('#users').click();
151151

152152
// Then I see that the current page is the users!
153153
cy.url().should('include', '/users');
154154

155155
// The selected menu is users.
156-
cy.get('[href="/users"]').should('have.class', 'Mui-selected');
156+
cy.get('#users').should('have.class', 'Mui-selected');
157157
});
158158

159159
it('should navigate to the profile page', () => {
@@ -167,6 +167,42 @@ describe('Menu', () => {
167167
cy.url().should('include', '/profile');
168168
});
169169

170+
it('The menu should be smaller', () => {
171+
// The menu should be smaller.
172+
cy.get('#closure').should('exist').click();
173+
cy.get('#expand').should('exist');
174+
cy.get('#closure').should('not.exist');
175+
176+
// Go to tokens page.
177+
cy.get('#developer').click();
178+
179+
cy.get('#personal-access-tokens').click();
180+
181+
// Then I see that the current page is the tokens!
182+
cy.url().should('include', '/developer/personal-access-tokens');
183+
184+
// Go to jobs page.
185+
cy.get('#jobs').click();
186+
cy.get('#preheats').click();
187+
188+
// Then I see that the current page is the preheats!
189+
cy.url().should('include', '/jobs/preheats');
190+
191+
// Go to task page.
192+
cy.get('#jobs').click();
193+
cy.get('#task').click();
194+
195+
// Then I see that the current page is the task!
196+
cy.url().should('include', '/jobs/task/clear');
197+
198+
// Go to user page.
199+
200+
cy.get('#users').click();
201+
202+
// Then I see that the current page is the users!
203+
cy.url().should('include', '/users');
204+
});
205+
170206
it('can logout', () => {
171207
cy.intercept(
172208
{
@@ -217,5 +253,9 @@ describe('Menu', () => {
217253
cy.get('.MuiAlert-action > .MuiButtonBase-root').click();
218254
cy.get('.MuiAlert-message').should('not.exist');
219255
});
256+
257+
it('should jump to GitHub', () => {
258+
cy.get('#github').should('have.attr', 'href').and('include', 'https://github.com/dragonflyoss/dragonfly');
259+
});
220260
});
221261
});

0 commit comments

Comments
 (0)