Beispiel #1
0
class TestTigreBuild(TestCase):
    def setUp(self):
        self.tigre = Tigre()

    @mock.patch('selenium.webdriver.Remote')
    def test_should_call_selenium_with_default_url(self, mock):
        self.tigre.build()

        mock.assert_called_with(
            command_executor='http://*****:*****@mock.patch('selenium.webdriver.Remote')
    def test_should_call_selenium_with_configurantion_modified(self, mock):
        with config_wrapper('remote_url', 'test_url'):
            self.tigre.build()

        mock.assert_called_with(
            command_executor='test_url', desired_capabilities={}
        )
Beispiel #2
0
 def setUp(self):
     self.tigre = Tigre()
Beispiel #3
0
    def test_should_return_value_if_was_fixed(self):
        tigre = Tigre()
        tigre._fixed_caps = {'batatinha': 123}

        self.assertEqual(tigre.batatinha, 123)
Beispiel #4
0
    def test_closure_shouldnt_convert_booleans_caps(self):
        tigre = Tigre(default_caps=['enableVNC'])
        tigre.vnc(True)

        self.assertIn(True, tigre.capabilities.values())
Beispiel #5
0
    def test_should_raises_with_wrog_caps(self):
        tigre = Tigre(default_caps=[])

        with self.assertRaises(AttributeError):
            tigre.test('test')
Beispiel #6
0
    def test_closure_should_convert_non_booleans_caps(self):
        tigre = Tigre(default_caps=['version'])
        tigre.version(7)

        self.assertEqual(tigre.capabilities['version'], '7')
Beispiel #7
0
    def test_closure_should_insert_new_caps(self):
        tigre = Tigre()
        tigre.version(None)

        self.assertIn('version', tigre.capabilities)
Beispiel #8
0
    def test_closure_should_return_self(self):
        tigre = Tigre()

        self.assertIs(tigre.version(None), tigre)
Beispiel #9
0
    def test_new_attr_should_return_callable(self):
        tigre = Tigre()
        tigre.version

        self.assertTrue(hasattr(tigre.version, '__call__'))
Beispiel #10
0
    def test_should_set_new_attrs(self):
        tigre = Tigre()
        tigre.version

        self.assertTrue(tigre.version)