1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package edu.samplu.krad.demo.uif.library.navigation.magic;
18
19 import org.junit.runners.BlockJUnit4ClassRunner;
20 import org.junit.runners.model.FrameworkMethod;
21 import org.junit.runners.model.InitializationError;
22 import org.junit.runners.model.Statement;
23
24 import java.lang.reflect.Method;
25
26 public class MagicSmokeTestRunner extends BlockJUnit4ClassRunner {
27
28 public MagicSmokeTestRunner(Class<?> type) throws InitializationError {
29 super(type);
30 }
31
32 @Override
33 protected Statement methodInvoker(FrameworkMethod method, Object test) {
34 Method testMethod = method.getMethod();
35 if (testMethod.getName().endsWith("Bookmark")) {
36 ((MagicWebDriverLegacyITBase) test).enableBookmarkMode();
37 } else if (testMethod.getName().endsWith("Nav")) {
38 ((MagicWebDriverLegacyITBase) test).enableNavigationMode();
39 }
40 return super.methodInvoker(method, test);
41 }
42
43 }
44