Skip to content

Commit a6367d5

Browse files
committed
Rename test cases and corresponding snapshots
- Use new, fuller names when clicking theme menu items. - Update test case names to consistently refer to the theme, except for the default theme (Classic Light), which is omitted. - Update snapshot image file names to match changed test case names. I exported a patch and winnowed it down to a set of replacements, and then had ChatGPT give me this Powershell script: # Define the replacements as old -> new mappings $replacements = @{ "modern theme eye gaze mode"="modern light theme -- eye gaze mode"; "modern theme"="modern light theme -- main screenshot"; "modern theme edit colors dialog (expanded)"="modern light theme -- edit colors dialog (expanded)"; "winter theme"="winter theme -- main screenshot"; "winter theme edit colors dialog (expanded)"="winter theme -- edit colors dialog (expanded)"; "winter theme vertical color box"="winter theme -- vertical color box"; "classic theme vertical color box"="'vertical color box"; "classic theme edit colors dialog"="edit colors dialog"; "modern theme vertical color box"="modern light theme -- vertical color box" } # Get all files in the current directory $files = Get-ChildItem -File foreach ($file in $files) { # Store the original file name $originalName = $file.Name # Perform each replacement on the file name foreach ($replacement in $replacements.GetEnumerator()) { if ($originalName -like "*$($replacement.Key)*") { $newName = $originalName -replace [regex]::Escape($replacement.Key), $replacement.Value Rename-Item -Path $originalName -NewName $newName # Update originalName to handle multiple replacements $originalName = $newName } } }
1 parent eef07b6 commit a6367d5

10 files changed

+12
-12
lines changed

β€Žcypress/integration/visual-tests.spec.jsβ€Ž

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -155,9 +155,9 @@ context('visual tests', () => {
155155
cy.matchImageSnapshot(withTextCompareOptions);
156156
});
157157

158-
it('modern theme eye gaze mode', () => {
158+
it('modern light theme -- eye gaze mode', () => {
159159
cy.get(".eye-gaze-mode-undo-button").should('exist');
160-
selectTheme("Modern");
160+
selectTheme("Modern Light");
161161
// clickMenuButton("View");
162162
// cy.get("body").trigger("pointermove", { clientX: 200, clientY: 150 });
163163
cy.wait(100);
@@ -171,7 +171,7 @@ context('visual tests', () => {
171171
cy.get(".eye-gaze-mode-undo-button").should('not.exist');
172172
});
173173

174-
it('modern theme', () => {
174+
it('modern light theme -- main screenshot', () => {
175175
cy.wait(100);
176176
// clickMenuButton("View");
177177
// cy.get("body").trigger("pointermove", { clientX: 200, clientY: 150 });
@@ -189,19 +189,19 @@ context('visual tests', () => {
189189
}
190190
cy.get('.window:visible').matchImageSnapshot(Object.assign({}, withTextCompareOptions));
191191
};
192-
it('modern theme edit colors dialog (expanded)', test_edit_colors_dialog);
192+
it('modern light theme -- edit colors dialog (expanded)', test_edit_colors_dialog);
193193

194-
it('winter theme', () => {
194+
it('winter theme -- main screenshot', () => {
195195
selectTheme("Winter");
196196
// clickMenuButton("View");
197197
// cy.get("body").trigger("pointermove", { clientX: 200, clientY: 150 });
198198
cy.wait(100);
199199
cy.matchImageSnapshot(withTextCompareOptions);
200200
});
201201

202-
it('winter theme edit colors dialog (expanded)', test_edit_colors_dialog);
202+
it('winter theme -- edit colors dialog (expanded)', test_edit_colors_dialog);
203203

204-
it('winter theme vertical color box', () => {
204+
it('winter theme -- vertical color box', () => {
205205
cy.wait(500);
206206
clickMenuButton("Extras");
207207
clickMenuItem("Vertical Color Box");
@@ -211,17 +211,17 @@ context('visual tests', () => {
211211
cy.matchImageSnapshot(withTextCompareOptions);
212212
});
213213

214-
it('classic theme vertical color box', () => {
215-
selectTheme("Classic");
214+
it('vertical color box', () => {
215+
selectTheme("Classic Light");
216216
cy.matchImageSnapshot(withTextCompareOptions);
217217
});
218218

219-
it('classic theme edit colors dialog', () => {
219+
it('edit colors dialog', () => {
220220
test_edit_colors_dialog(false);
221221
});
222222

223-
it('modern theme vertical color box', () => {
224-
selectTheme("Modern");
223+
it('modern light theme -- vertical color box', () => {
224+
selectTheme("Modern Light");
225225
cy.matchImageSnapshot(withTextCompareOptions);
226226
});
227227

0 commit comments

Comments
Β (0)