### Question:
CapabilitiesLoader { public void loadCapabilities(String fileName) { loadCapabilities(fileName, false); }  void loadCapabilities(String fileName); void loadCapabilities(String fileName, boolean currentTestOnly); DesiredCapabilities getCapabilities(String fileName);  }### Answer:
@Test(expectedExceptions = { AssertionError.class }, expectedExceptionsMessageRegExp = "Unable to find custom capabilities file 'unexisting_file'!") public void loadCapabilitiesFromNonExistingFileTest() { new CapabilitiesLoader().loadCapabilities("unexisting_file"); }
@Test(dependsOnMethods = { "getCapabilitiesTest" }) public void loadTempCapabilitiesTest() { new CapabilitiesLoader().loadCapabilities(customCapabilities, true); Assert.assertEquals(R.CONFIG.get("capabilities." + stringParam), stringValue, "Returned capability value is not valid!"); Assert.assertTrue(R.CONFIG.getBoolean("capabilities." + booleanParamTrue), "Returned capability value is not valid!"); Assert.assertFalse(R.CONFIG.getBoolean("capabilities." + booleanParamFalse), "Returned capability value is not valid!"); Assert.assertEquals(R.CONFIG.get(coreParam), coreValue, "Returned property value is not valid!"); }
@Test(dependsOnMethods = { "loadTempCapabilitiesTest" }) public void loadGlobalCapabilitiesTest() { new CapabilitiesLoader().loadCapabilities(customCapabilities); Assert.assertEquals(R.CONFIG.get("capabilities." + stringParam), stringValue, "Returned capability value is not valid!"); Assert.assertTrue(R.CONFIG.getBoolean("capabilities." + booleanParamTrue), "Returned capability value is not valid!"); Assert.assertFalse(R.CONFIG.getBoolean("capabilities." + booleanParamFalse), "Returned capability value is not valid!"); Assert.assertEquals(R.CONFIG.get(coreParam), coreValue, "Returned property value is not valid!"); }