|
1 | 1 | require("module-alias/register");
|
| 2 | +import { sendCustomKeybinds } from "@helpers/commands"; |
2 | 3 | import { MACOS_DRIVER } from "@helpers/constants";
|
3 | 4 | import SettingsExtensionsScreen from "@screenobjects/settings/SettingsExtensionsScreen";
|
4 | 5 | import SettingsKeybindsScreen from "@screenobjects/settings/SettingsKeybindsScreen";
|
@@ -119,4 +120,75 @@ export default async function settingsKeybindsTests() {
|
119 | 120 | await settingsKeybinds.getKeybinds("hide-focus-uplink");
|
120 | 121 | await expect(hideFocusUplinkKeybind).toEqual(["CONTROL", "SHIFT", "U"]);
|
121 | 122 | });
|
| 123 | + |
| 124 | + it("Settings Keyboards Shortcuts - Change Increase Font Size Keybind", async () => { |
| 125 | + // Type Ctrl + Shift + = |
| 126 | + await sendCustomKeybinds(4, 7, 73); |
| 127 | + await settingsKeybinds.editKeybind("increase-font-size"); |
| 128 | + // Type Ctrl + A |
| 129 | + await sendCustomKeybinds(4, 45); |
| 130 | + |
| 131 | + const increaseFontSizeKeybind = |
| 132 | + await settingsKeybinds.getKeybinds("increase-font-size"); |
| 133 | + await expect(increaseFontSizeKeybind).toEqual(["CONTROL", "A"]); |
| 134 | + }); |
| 135 | + |
| 136 | + it("Settings Keyboards Shortcuts - Reset Increase Font Size Keybind", async () => { |
| 137 | + await settingsKeybinds.clickOnRevertIncreaseFontSize(); |
| 138 | + const increaseFontSizeKeybind = |
| 139 | + await settingsKeybinds.getKeybinds("increase-font-size"); |
| 140 | + await expect(increaseFontSizeKeybind).toEqual(["CONTROL", "SHIFT", "="]); |
| 141 | + }); |
| 142 | + |
| 143 | + it("Settings Keyboards Shortcuts - User can update more than one keybind", async () => { |
| 144 | + // Change at least two different keybinds. First, change Decrease Font Size Keybind, by typing Ctrl + Shift + - |
| 145 | + await sendCustomKeybinds(4, 7, 72); |
| 146 | + // Edit Decrease Font Size Keybind to Ctrl + B |
| 147 | + await settingsKeybinds.editKeybind("decrease-font-size"); |
| 148 | + await sendCustomKeybinds(4, 46); |
| 149 | + |
| 150 | + // Validate change was applied correctly to Decrease Font Size Keybind |
| 151 | + const decreaseFontSizeKeybind = |
| 152 | + await settingsKeybinds.getKeybinds("decrease-font-size"); |
| 153 | + await expect(decreaseFontSizeKeybind).toEqual(["CONTROL", "B"]); |
| 154 | + |
| 155 | + // Now, change Hide/Focus Uplink Keybind by typing Ctrl + Shift + U |
| 156 | + await sendCustomKeybinds(4, 7, 65); |
| 157 | + await settingsKeybinds.editKeybind("hide-focus-uplink"); |
| 158 | + // Type Alt + Ctrl + Shift + P |
| 159 | + await sendCustomKeybinds(3, 4, 7, 60); |
| 160 | + |
| 161 | + // Validate change was applied correctly to Hide/Focus Uplink Keybind |
| 162 | + const hideFocusUplinkKeybind = |
| 163 | + await settingsKeybinds.getKeybinds("hide-focus-uplink"); |
| 164 | + await expect(hideFocusUplinkKeybind).toEqual([ |
| 165 | + "ALT", |
| 166 | + "CONTROL", |
| 167 | + "SHIFT", |
| 168 | + "P", |
| 169 | + ]); |
| 170 | + }); |
| 171 | + |
| 172 | + it("Settings Keyboards Shortcuts - User can revert all Keybinds to Default Values", async () => { |
| 173 | + // Click on Revert all keybinds |
| 174 | + await settingsKeybinds.clickOnRevertAllKeybinds(); |
| 175 | + |
| 176 | + // Validate default keys are assigned for Decrease Font Size Keybind (Ctrl + Shift + -) |
| 177 | + const decreaseFontSizeKeybindDefault = |
| 178 | + await settingsKeybinds.getKeybinds("decrease-font-size"); |
| 179 | + await expect(decreaseFontSizeKeybindDefault).toEqual([ |
| 180 | + "CONTROL", |
| 181 | + "SHIFT", |
| 182 | + "-", |
| 183 | + ]); |
| 184 | + |
| 185 | + // Validate default keys are assigned for Hide/Show Uplink Keybind (Ctrl + Shift + U) |
| 186 | + const hideFocusUplinkKeybindDefault = |
| 187 | + await settingsKeybinds.getKeybinds("hide-focus-uplink"); |
| 188 | + await expect(hideFocusUplinkKeybindDefault).toEqual([ |
| 189 | + "CONTROL", |
| 190 | + "SHIFT", |
| 191 | + "U", |
| 192 | + ]); |
| 193 | + }); |
122 | 194 | }
|
0 commit comments