Best Python code snippet using autotest_python
test_introspect.py
Source:test_introspect.py
1# Licensed under the Apache License, Version 2.0 (the "License");2# you may not use this file except in compliance with the License.3# You may obtain a copy of the License at4#5# http://www.apache.org/licenses/LICENSE-2.06#7# Unless required by applicable law or agreed to in writing, software8# distributed under the License is distributed on an "AS IS" BASIS,9# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or10# implied.11# See the License for the specific language governing permissions and12# limitations under the License.13import collections14import time15import fixtures16from ironicclient import exceptions17import mock18from oslo_config import cfg19from ironic_inspector.common import ironic as ir_utils20from ironic_inspector import introspect21from ironic_inspector import introspection_state as istate22from ironic_inspector import node_cache23from ironic_inspector.pxe_filter import base as pxe_filter24from ironic_inspector.test import base as test_base25from ironic_inspector import utils26CONF = cfg.CONF27class BaseTest(test_base.NodeTest):28 def setUp(self):29 super(BaseTest, self).setUp()30 introspect._LAST_INTROSPECTION_TIME = 031 self.node.power_state = 'power off'32 self.ports = [mock.Mock(address=m) for m in self.macs]33 self.ports_dict = collections.OrderedDict((p.address, p)34 for p in self.ports)35 self.node_info = mock.Mock(uuid=self.uuid, options={})36 self.node_info.ports.return_value = self.ports_dict37 self.node_info.node.return_value = self.node38 driver_fixture = self.useFixture(fixtures.MockPatchObject(39 pxe_filter, 'driver', autospec=True))40 driver_mock = driver_fixture.mock.return_value41 self.sync_filter_mock = driver_mock.sync42 def _prepare(self, client_mock):43 cli = client_mock.return_value44 cli.node.get.return_value = self.node45 cli.node.validate.return_value = mock.Mock(power={'result': True})46 return cli47@mock.patch.object(node_cache, 'start_introspection', autospec=True)48@mock.patch.object(ir_utils, 'get_client', autospec=True)49class TestIntrospect(BaseTest):50 def test_ok(self, client_mock, start_mock):51 cli = self._prepare(client_mock)52 start_mock.return_value = self.node_info53 introspect.introspect(self.node.uuid)54 cli.node.get.assert_called_once_with(self.uuid)55 cli.node.validate.assert_called_once_with(self.uuid)56 start_mock.assert_called_once_with(self.uuid,57 bmc_address=[self.bmc_address],58 manage_boot=True,59 ironic=cli)60 self.node_info.ports.assert_called_once_with()61 self.node_info.add_attribute.assert_called_once_with('mac',62 self.macs)63 self.sync_filter_mock.assert_called_with(cli)64 cli.node.set_boot_device.assert_called_once_with(self.uuid,65 'pxe',66 persistent=False)67 cli.node.set_power_state.assert_called_once_with(self.uuid,68 'reboot')69 self.node_info.acquire_lock.assert_called_once_with()70 self.node_info.release_lock.assert_called_once_with()71 @mock.patch.object(ir_utils, 'get_ipmi_address', autospec=True)72 def test_resolved_bmc_address(self, ipmi_mock, client_mock, start_mock):73 self.node.driver_info['ipmi_address'] = 'example.com'74 addresses = ['93.184.216.34', '2606:2800:220:1:248:1893:25c8:1946']75 ipmi_mock.return_value = ('example.com',) + tuple(addresses)76 cli = self._prepare(client_mock)77 start_mock.return_value = self.node_info78 introspect.introspect(self.node.uuid)79 cli.node.get.assert_called_once_with(self.uuid)80 cli.node.validate.assert_called_once_with(self.uuid)81 start_mock.assert_called_once_with(self.uuid,82 bmc_address=addresses,83 manage_boot=True,84 ironic=cli)85 self.node_info.ports.assert_called_once_with()86 self.node_info.add_attribute.assert_called_once_with('mac',87 self.macs)88 self.sync_filter_mock.assert_called_with(cli)89 cli.node.set_boot_device.assert_called_once_with(self.uuid,90 'pxe',91 persistent=False)92 cli.node.set_power_state.assert_called_once_with(self.uuid,93 'reboot')94 self.node_info.acquire_lock.assert_called_once_with()95 self.node_info.release_lock.assert_called_once_with()96 def test_loopback_bmc_address(self, client_mock, start_mock):97 self.node.driver_info['ipmi_address'] = '127.0.0.1'98 cli = self._prepare(client_mock)99 start_mock.return_value = self.node_info100 introspect.introspect(self.node.uuid)101 cli.node.get.assert_called_once_with(self.uuid)102 cli.node.validate.assert_called_once_with(self.uuid)103 start_mock.assert_called_once_with(self.uuid,104 bmc_address=[],105 manage_boot=True,106 ironic=cli)107 self.node_info.ports.assert_called_once_with()108 self.node_info.add_attribute.assert_called_once_with('mac',109 self.macs)110 self.sync_filter_mock.assert_called_with(cli)111 cli.node.set_boot_device.assert_called_once_with(self.uuid,112 'pxe',113 persistent=False)114 cli.node.set_power_state.assert_called_once_with(self.uuid,115 'reboot')116 self.node_info.acquire_lock.assert_called_once_with()117 self.node_info.release_lock.assert_called_once_with()118 def test_ok_ilo_and_drac(self, client_mock, start_mock):119 cli = self._prepare(client_mock)120 start_mock.return_value = self.node_info121 for name in ('ilo_address', 'drac_host'):122 self.node.driver_info = {name: self.bmc_address}123 introspect.introspect(self.node.uuid)124 start_mock.assert_called_with(self.uuid,125 bmc_address=[self.bmc_address],126 manage_boot=True,127 ironic=cli)128 def test_power_failure(self, client_mock, start_mock):129 cli = self._prepare(client_mock)130 cli.node.set_power_state.side_effect = exceptions.BadRequest()131 start_mock.return_value = self.node_info132 introspect.introspect(self.node.uuid)133 cli.node.get.assert_called_once_with(self.uuid)134 start_mock.assert_called_once_with(self.uuid,135 bmc_address=[self.bmc_address],136 manage_boot=True,137 ironic=cli)138 cli.node.set_boot_device.assert_called_once_with(self.uuid,139 'pxe',140 persistent=False)141 cli.node.set_power_state.assert_called_once_with(self.uuid,142 'reboot')143 start_mock.return_value.finished.assert_called_once_with(144 introspect.istate.Events.error, error=mock.ANY)145 self.node_info.acquire_lock.assert_called_once_with()146 self.node_info.release_lock.assert_called_once_with()147 def test_unexpected_error(self, client_mock, start_mock):148 cli = self._prepare(client_mock)149 start_mock.return_value = self.node_info150 self.sync_filter_mock.side_effect = RuntimeError()151 introspect.introspect(self.node.uuid)152 cli.node.get.assert_called_once_with(self.uuid)153 start_mock.assert_called_once_with(self.uuid,154 bmc_address=[self.bmc_address],155 manage_boot=True,156 ironic=cli)157 self.assertFalse(cli.node.set_boot_device.called)158 start_mock.return_value.finished.assert_called_once_with(159 introspect.istate.Events.error, error=mock.ANY)160 self.node_info.acquire_lock.assert_called_once_with()161 self.node_info.release_lock.assert_called_once_with()162 def test_set_boot_device_failure(self, client_mock, start_mock):163 cli = self._prepare(client_mock)164 cli.node.set_boot_device.side_effect = exceptions.BadRequest()165 start_mock.return_value = self.node_info166 introspect.introspect(self.node.uuid)167 cli.node.get.assert_called_once_with(self.uuid)168 start_mock.assert_called_once_with(self.uuid,169 bmc_address=[self.bmc_address],170 manage_boot=True,171 ironic=cli)172 cli.node.set_boot_device.assert_called_once_with(self.uuid,173 'pxe',174 persistent=False)175 cli.node.set_power_state.assert_not_called()176 start_mock.return_value.finished.assert_called_once_with(177 introspect.istate.Events.error, error=mock.ANY)178 self.node_info.acquire_lock.assert_called_once_with()179 self.node_info.release_lock.assert_called_once_with()180 def test_no_macs(self, client_mock, start_mock):181 cli = self._prepare(client_mock)182 self.node_info.ports.return_value = []183 start_mock.return_value = self.node_info184 introspect.introspect(self.node.uuid)185 self.node_info.ports.assert_called_once_with()186 start_mock.assert_called_once_with(self.uuid,187 bmc_address=[self.bmc_address],188 manage_boot=True,189 ironic=cli)190 self.assertFalse(self.node_info.add_attribute.called)191 self.assertFalse(self.sync_filter_mock.called)192 cli.node.set_boot_device.assert_called_once_with(self.uuid,193 'pxe',194 persistent=False)195 cli.node.set_power_state.assert_called_once_with(self.uuid,196 'reboot')197 def test_no_lookup_attrs(self, client_mock, start_mock):198 cli = self._prepare(client_mock)199 self.node_info.ports.return_value = []200 start_mock.return_value = self.node_info201 self.node_info.attributes = {}202 introspect.introspect(self.uuid)203 self.node_info.ports.assert_called_once_with()204 self.node_info.finished.assert_called_once_with(205 introspect.istate.Events.error, error=mock.ANY)206 self.assertEqual(0, self.sync_filter_mock.call_count)207 self.assertEqual(0, cli.node.set_power_state.call_count)208 self.node_info.acquire_lock.assert_called_once_with()209 self.node_info.release_lock.assert_called_once_with()210 def test_no_lookup_attrs_with_node_not_found_hook(self, client_mock,211 start_mock):212 CONF.set_override('node_not_found_hook', 'example', 'processing')213 cli = self._prepare(client_mock)214 self.node_info.ports.return_value = []215 start_mock.return_value = self.node_info216 self.node_info.attributes = {}217 introspect.introspect(self.uuid)218 self.node_info.ports.assert_called_once_with()219 self.assertFalse(self.node_info.finished.called)220 cli.node.set_boot_device.assert_called_once_with(self.uuid,221 'pxe',222 persistent=False)223 cli.node.set_power_state.assert_called_once_with(self.uuid,224 'reboot')225 def test_failed_to_get_node(self, client_mock, start_mock):226 cli = client_mock.return_value227 cli.node.get.side_effect = exceptions.NotFound()228 self.assertRaisesRegex(utils.Error,229 'Node %s was not found' % self.uuid,230 introspect.introspect, self.uuid)231 cli.node.get.side_effect = exceptions.BadRequest()232 self.assertRaisesRegex(utils.Error,233 '%s: Bad Request' % self.uuid,234 introspect.introspect, self.uuid)235 self.assertEqual(0, self.node_info.ports.call_count)236 self.assertEqual(0, self.sync_filter_mock.call_count)237 self.assertEqual(0, cli.node.set_power_state.call_count)238 self.assertFalse(start_mock.called)239 self.assertFalse(self.node_info.acquire_lock.called)240 def test_failed_to_validate_node(self, client_mock, start_mock):241 cli = client_mock.return_value242 cli.node.get.return_value = self.node243 cli.node.validate.return_value = mock.Mock(power={'result': False,244 'reason': 'oops'})245 self.assertRaisesRegex(246 utils.Error,247 'Failed validation of power interface',248 introspect.introspect, self.uuid)249 cli.node.validate.assert_called_once_with(self.uuid)250 self.assertEqual(0, self.node_info.ports.call_count)251 self.assertEqual(0, self.sync_filter_mock.call_count)252 self.assertEqual(0, cli.node.set_power_state.call_count)253 self.assertFalse(start_mock.called)254 self.assertFalse(self.node_info.acquire_lock.called)255 def test_wrong_provision_state(self, client_mock, start_mock):256 self.node.provision_state = 'active'257 cli = client_mock.return_value258 cli.node.get.return_value = self.node259 self.assertRaisesRegex(260 utils.Error, 'Invalid provision state for introspection: "active"',261 introspect.introspect, self.uuid)262 self.assertEqual(0, self.node_info.ports.call_count)263 self.assertEqual(0, self.sync_filter_mock.call_count)264 self.assertEqual(0, cli.node.set_power_state.call_count)265 self.assertFalse(start_mock.called)266 self.assertFalse(self.node_info.acquire_lock.called)267 def test_inspect_wait_state_allowed(self, client_mock, start_mock):268 self.node.provision_state = 'inspect wait'269 cli = client_mock.return_value270 cli.node.get.return_value = self.node271 cli.node.validate.return_value = mock.Mock(power={'result': True})272 introspect.introspect(self.uuid)273 self.assertTrue(start_mock.called)274 @mock.patch.object(time, 'time')275 def test_introspection_delay(self, time_mock, client_mock, start_mock):276 time_mock.return_value = 42277 introspect._LAST_INTROSPECTION_TIME = 40278 CONF.set_override('introspection_delay', 10)279 cli = self._prepare(client_mock)280 start_mock.return_value = self.node_info281 introspect.introspect(self.uuid)282 self.sleep_fixture.mock.assert_called_once_with(8)283 cli.node.set_boot_device.assert_called_once_with(self.uuid,284 'pxe',285 persistent=False)286 cli.node.set_power_state.assert_called_once_with(self.uuid,287 'reboot')288 # updated to the current time.time()289 self.assertEqual(42, introspect._LAST_INTROSPECTION_TIME)290 @mock.patch.object(time, 'time')291 def test_introspection_delay_not_needed(self, time_mock, client_mock,292 start_mock):293 time_mock.return_value = 100294 introspect._LAST_INTROSPECTION_TIME = 40295 CONF.set_override('introspection_delay', 10)296 cli = self._prepare(client_mock)297 start_mock.return_value = self.node_info298 introspect.introspect(self.uuid)299 self.sleep_fixture.mock().assert_not_called()300 cli.node.set_boot_device.assert_called_once_with(self.uuid,301 'pxe',302 persistent=False)303 cli.node.set_power_state.assert_called_once_with(self.uuid,304 'reboot')305 # updated to the current time.time()306 self.assertEqual(100, introspect._LAST_INTROSPECTION_TIME)307 def test_no_manage_boot(self, client_mock, add_mock):308 cli = self._prepare(client_mock)309 self.node_info.manage_boot = False310 add_mock.return_value = self.node_info311 introspect.introspect(self.node.uuid, manage_boot=False)312 cli.node.get.assert_called_once_with(self.uuid)313 add_mock.assert_called_once_with(self.uuid,314 bmc_address=[self.bmc_address],315 manage_boot=False,316 ironic=cli)317 self.node_info.ports.assert_called_once_with()318 self.node_info.add_attribute.assert_called_once_with('mac',319 self.macs)320 self.sync_filter_mock.assert_called_with(cli)321 self.assertFalse(cli.node.validate.called)322 self.assertFalse(cli.node.set_boot_device.called)323 self.assertFalse(cli.node.set_power_state.called)324@mock.patch.object(node_cache, 'get_node', autospec=True)325@mock.patch.object(ir_utils, 'get_client', autospec=True)326class TestAbort(BaseTest):327 def setUp(self):328 super(TestAbort, self).setUp()329 self.node_info.started_at = None330 self.node_info.finished_at = None331 # NOTE(milan): node_info.finished() is a mock; no fsm_event call, then332 self.fsm_calls = [333 mock.call(istate.Events.abort, strict=False),334 ]335 def test_ok(self, client_mock, get_mock):336 cli = self._prepare(client_mock)337 get_mock.return_value = self.node_info338 self.node_info.acquire_lock.return_value = True339 self.node_info.started_at = time.time()340 self.node_info.finished_at = None341 introspect.abort(self.node.uuid)342 get_mock.assert_called_once_with(self.uuid, ironic=cli,343 locked=False)344 self.node_info.acquire_lock.assert_called_once_with(blocking=False)345 self.sync_filter_mock.assert_called_once_with(cli)346 cli.node.set_power_state.assert_called_once_with(self.uuid, 'off')347 self.node_info.finished.assert_called_once_with(348 introspect.istate.Events.abort_end, error='Canceled by operator')349 self.node_info.fsm_event.assert_has_calls(self.fsm_calls)350 def test_no_manage_boot(self, client_mock, get_mock):351 cli = self._prepare(client_mock)352 get_mock.return_value = self.node_info353 self.node_info.acquire_lock.return_value = True354 self.node_info.started_at = time.time()355 self.node_info.finished_at = None356 self.node_info.manage_boot = False357 introspect.abort(self.node.uuid)358 get_mock.assert_called_once_with(self.uuid, ironic=cli,359 locked=False)360 self.node_info.acquire_lock.assert_called_once_with(blocking=False)361 self.sync_filter_mock.assert_called_once_with(cli)362 self.assertFalse(cli.node.set_power_state.called)363 self.node_info.finished.assert_called_once_with(364 introspect.istate.Events.abort_end, error='Canceled by operator')365 self.node_info.fsm_event.assert_has_calls(self.fsm_calls)366 def test_node_not_found(self, client_mock, get_mock):367 cli = self._prepare(client_mock)368 exc = utils.Error('Not found.', code=404)369 get_mock.side_effect = exc370 self.assertRaisesRegex(utils.Error, str(exc),371 introspect.abort, self.uuid)372 self.assertEqual(0, self.sync_filter_mock.call_count)373 self.assertEqual(0, cli.node.set_power_state.call_count)374 self.assertEqual(0, self.node_info.finished.call_count)375 self.assertEqual(0, self.node_info.fsm_event.call_count)376 def test_node_locked(self, client_mock, get_mock):377 cli = self._prepare(client_mock)378 get_mock.return_value = self.node_info379 self.node_info.acquire_lock.return_value = False380 self.node_info.started_at = time.time()381 self.assertRaisesRegex(utils.Error, 'Node is locked, please, '382 'retry later', introspect.abort, self.uuid)383 self.assertEqual(0, self.sync_filter_mock.call_count)384 self.assertEqual(0, cli.node.set_power_state.call_count)385 self.assertEqual(0, self.node_info.finshed.call_count)386 self.assertEqual(0, self.node_info.fsm_event.call_count)387 def test_firewall_update_exception(self, client_mock, get_mock):388 cli = self._prepare(client_mock)389 get_mock.return_value = self.node_info390 self.node_info.acquire_lock.return_value = True391 self.node_info.started_at = time.time()392 self.node_info.finished_at = None393 self.sync_filter_mock.side_effect = Exception('Boom')394 introspect.abort(self.uuid)395 get_mock.assert_called_once_with(self.uuid, ironic=cli,396 locked=False)397 self.node_info.acquire_lock.assert_called_once_with(blocking=False)398 self.sync_filter_mock.assert_called_once_with(cli)399 cli.node.set_power_state.assert_called_once_with(self.uuid, 'off')400 self.node_info.finished.assert_called_once_with(401 introspect.istate.Events.abort_end, error='Canceled by operator')402 self.node_info.fsm_event.assert_has_calls(self.fsm_calls)403 def test_node_power_off_exception(self, client_mock, get_mock):404 cli = self._prepare(client_mock)405 get_mock.return_value = self.node_info406 self.node_info.acquire_lock.return_value = True407 self.node_info.started_at = time.time()408 self.node_info.finished_at = None409 cli.node.set_power_state.side_effect = Exception('BadaBoom')410 introspect.abort(self.uuid)411 get_mock.assert_called_once_with(self.uuid, ironic=cli,412 locked=False)413 self.node_info.acquire_lock.assert_called_once_with(blocking=False)414 self.sync_filter_mock.assert_called_once_with(cli)415 cli.node.set_power_state.assert_called_once_with(self.uuid, 'off')416 self.node_info.finished.assert_called_once_with(417 introspect.istate.Events.abort_end, error='Canceled by operator')...
test_power.py
Source:test_power.py
...53 self.assertRaises(exception.DracOperationError,54 task.driver.power.get_power_state, task)55 mock_client.get_power_state.assert_called_once_with()56 @mock.patch.object(drac_power.LOG, 'warning', autospec=True)57 def test_set_power_state(self, mock_log, mock_get_drac_client):58 mock_client = mock_get_drac_client.return_value59 mock_client.get_power_state.side_effect = [drac_constants.POWER_ON,60 drac_constants.POWER_OFF]61 with task_manager.acquire(self.context, self.node.uuid,62 shared=False) as task:63 task.driver.power.set_power_state(task, states.POWER_OFF)64 drac_power_state = drac_power.REVERSE_POWER_STATES[states.POWER_OFF]65 mock_client.set_power_state.assert_called_once_with(drac_power_state)66 self.assertFalse(mock_log.called)67 def test_set_power_state_fail(self, mock_get_drac_client):68 mock_client = mock_get_drac_client.return_value69 exc = drac_exceptions.BaseClientException('boom')70 mock_client.set_power_state.side_effect = exc71 with task_manager.acquire(self.context, self.node.uuid,72 shared=False) as task:73 self.assertRaises(exception.DracOperationError,74 task.driver.power.set_power_state, task,75 states.POWER_OFF)76 drac_power_state = drac_power.REVERSE_POWER_STATES[states.POWER_OFF]77 mock_client.set_power_state.assert_called_once_with(drac_power_state)78 @mock.patch.object(drac_power.LOG, 'warning', autospec=True)79 def test_set_power_state_timeout(self, mock_log, mock_get_drac_client):80 mock_client = mock_get_drac_client.return_value81 mock_client.get_power_state.side_effect = [drac_constants.POWER_ON,82 drac_constants.POWER_OFF]83 with task_manager.acquire(self.context, self.node.uuid,84 shared=False) as task:85 task.driver.power.set_power_state(task, states.POWER_OFF,86 timeout=11)87 drac_power_state = drac_power.REVERSE_POWER_STATES[states.POWER_OFF]88 mock_client.set_power_state.assert_called_once_with(drac_power_state)89 self.assertFalse(mock_log.called)90 @mock.patch.object(drac_power.LOG, 'warning', autospec=True)91 def test_reboot_while_powered_on(self, mock_log, mock_get_drac_client):92 mock_client = mock_get_drac_client.return_value93 mock_client.get_power_state.return_value = drac_constants.POWER_ON94 with task_manager.acquire(self.context, self.node.uuid,95 shared=False) as task:96 task.driver.power.reboot(task)97 drac_power_state = drac_power.REVERSE_POWER_STATES[states.REBOOT]98 mock_client.set_power_state.assert_called_once_with(drac_power_state)99 self.assertFalse(mock_log.called)...
ControlFGSCPower.py
Source:ControlFGSCPower.py
...11 self.fg_power_setting = 112 self.sc_power_setting = 113 self._hw_mgr_server = None14 self._hw_mgr_lock = utils.Lock(self._log)15 self._hw_mgr_server = utils.set_power_state('fg', 'on', self._hw_mgr_server, self._hw_mgr_lock, self._log)16 self._hw_mgr_server = utils.set_power_state('sc', 'on', self._hw_mgr_server, self._hw_mgr_lock, self._log)17 18 def run(self): 19 self._control_fgsc_power()20 21 def stop(self):22 self._hw_mgr_server = utils.set_power_state('fg', 'off', self._hw_mgr_server, self._hw_mgr_lock, self._log)23 self._hw_mgr_server = utils.set_power_state('sc', 'off', self._hw_mgr_server, self._hw_mgr_lock, self._log)24 25 def _control_fgsc_power(self):26 """If not in commanded state, send command to hw_mgr"""27 #self._log.info('Entering ControlFGSCPower._control_fgsc_power')28 [fg_power_state, self._hw_mgr_server] = utils.get_hw_status('fg_pwr', self._hw_mgr_server, self._hw_mgr_lock, self._log)29 if fg_power_state is not None:30 #self._log.info(' fg_power_state is %d' % fg_power_state)31 if fg_power_state != self.fg_power_setting:32 if self.fg_power_setting == 1:33 self._hw_mgr_server = utils.set_power_state('fg', 'on', self._hw_mgr_server, self._hw_mgr_lock, self._log)34 else:35 self._hw_mgr_server = utils.set_power_state('fg', 'off', self._hw_mgr_server, self._hw_mgr_lock, self._log) 36 [sc_power_state, self._hw_mgr_server] = utils.get_hw_status('sc_pwr', self._hw_mgr_server, self._hw_mgr_lock, self._log)37 if sc_power_state is not None:38 #self._log.info(' sc_power_state is %d' % sc_power_state)39 if sc_power_state != self.sc_power_setting:40 if self.sc_power_setting == 1:41 self._hw_mgr_server = utils.set_power_state('sc', 'on', self._hw_mgr_server, self._hw_mgr_lock, self._log)42 else:43 self._hw_mgr_server = utils.set_power_state('sc', 'off', self._hw_mgr_server, self._hw_mgr_lock, self._log)...
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!