{"action":"created","issue":{"url":"https://api.github.com/repos/frlp-utn-is-2018/orderingg/issues/61","repository_url":"https://api.github.com/repos/frlp-utn-is-2018/orderingg","labels_url":"https://api.github.com/repos/frlp-utn-is-2018/orderingg/issues/61/labels{/name}","comments_url":"https://api.github.com/repos/frlp-utn-is-2018/orderingg/issues/61/comments","events_url":"https://api.github.com/repos/frlp-utn-is-2018/orderingg/issues/61/events","html_url":"https://github.com/frlp-utn-is-2018/orderingg/issues/61","id":326824847,"number":61,"title":"problema de selerium productos repetidos","user":{"login":"SantiClausen","id":38263254,"avatar_url":"https://avatars3.githubusercontent.com/u/38263254?v=4","gravatar_id":"","url":"https://api.github.com/users/SantiClausen","html_url":"https://github.com/SantiClausen","followers_url":"https://api.github.com/users/SantiClausen/followers","following_url":"https://api.github.com/users/SantiClausen/following{/other_user}","gists_url":"https://api.github.com/users/SantiClausen/gists{/gist_id}","starred_url":"https://api.github.com/users/SantiClausen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SantiClausen/subscriptions","organizations_url":"https://api.github.com/users/SantiClausen/orgs","repos_url":"https://api.github.com/users/SantiClausen/repos","events_url":"https://api.github.com/users/SantiClausen/events{/privacy}","received_events_url":"https://api.github.com/users/SantiClausen/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-05-27T15:21:28Z","updated_at":"2018-05-27T15:57:52Z","closed_at":null,"author_association":"NONE","body":"estoy haciendo un ejercicio que me indica que debo hacer un test de selerium para ver si la notificación de productos repetidos aparece cuando. Como lei que la base de datos siempre empieza vacia, le agrege un producto y su order con anterioridad. Al usar la pagina, noto que la clase del selector cambia de \"select\" a \"select is-danger\" cuando le intento agregar un producto repetido, así que escribí el código:\r\n![image](https://user-images.githubusercontent.com/38263254/40587641-75de3564-61a8-11e8-8758-129e51d3631b.png)\r\npero al correrlo, me salta este error:\r\n```\r\n_________________ Ordering.test_productos_repetidos_OPCIONAL __________________\r\n\r\nself = <test.test_e2e.Ordering testMethod=test_productos_repetidos_OPCIONAL>\r\n\r\n    def test_productos_repetidos_OPCIONAL(self):\r\n        o=Order(id=1)\r\n        db.session.add(o)\r\n        p=Product(id=1, name='Individual', price=50)\r\n        db.session.add(p)\r\n        op=OrderProduct(order_id=1, product_id=1, product=p, quantity=25)\r\n        db.session.add(op)\r\n        db.session.commit()\r\n        driver = self.driver\r\n        driver.get(self.baseURL)\r\n        add_product_button = driver.find_element_by_xpath('/html/body/main/div[1                                ]/div/button')\r\n        add_product_button.click()\r\n        select_product = Select(driver.find_element_by_id('select-prod'))\r\n        select_product.select_by_visible_text(\"Individual\")\r\n        cantidad_product = driver.find_element_by_id('quantity')\r\n        cantidad_product .send_keys(\"1\")\r\n        guardar_button = driver.find_element_by_id('save-button')\r\n        guardar_button.click()\r\n>       danger_button = driver.find_element_by_class_name('select is-danger')\r\n\r\ntest_e2e.py:86:\r\n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _\r\nc:\\program files (x86)\\python36-32\\lib\\site-packages\\selenium\\webdriver\\remote\\w                                ebdriver.py:557: in find_element_by_class_name\r\n    return self.find_element(by=By.CLASS_NAME, value=name)\r\nc:\\program files (x86)\\python36-32\\lib\\site-packages\\selenium\\webdriver\\remote\\w                                ebdriver.py:957: in find_element\r\n    'value': value})['value']\r\nc:\\program files (x86)\\python36-32\\lib\\site-packages\\selenium\\webdriver\\remote\\w                                ebdriver.py:314: in execute\r\n    self.error_handler.check_response(response)\r\n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _\r\n\r\nself = <selenium.webdriver.remote.errorhandler.ErrorHandler object at 0x047C9410                                >\r\nresponse = {'sessionId': '16e16523830800d72614a6d1863eb7a1', 'status': 32, 'valu                                e': {'message': 'invalid selector: Compound class...r info: chromedriver=2.38.55                                2522 (437e6fbedfa8762dec75e2c5b3ddb86763dc9dcb),platform=Windows NT 6.1.7601 SP1                                 x86_64)'}}\r\n\r\n    def check_response(self, response):\r\n        \"\"\"\r\n            Checks that a JSON response from the WebDriver does not have an erro                                r.\r\n\r\n            :Args:\r\n             - response - The JSON response from the WebDriver server as a dicti                                onary\r\n               object.\r\n\r\n            :Raises: If the response contains an error message.\r\n            \"\"\"\r\n        status = response.get('status', None)\r\n        if status is None or status == ErrorCode.SUCCESS:\r\n            return\r\n        value = None\r\n        message = response.get(\"message\", \"\")\r\n        screen = response.get(\"screen\", \"\")\r\n        stacktrace = None\r\n        if isinstance(status, int):\r\n            value_json = response.get('value', None)\r\n            if value_json and isinstance(value_json, basestring):\r\n                import json\r\n                try:\r\n                    value = json.loads(value_json)\r\n                    if len(value.keys()) == 1:\r\n                        value = value['value']\r\n                    status = value.get('error', None)\r\n                    if status is None:\r\n                        status = value[\"status\"]\r\n                        message = value[\"value\"]\r\n                        if not isinstance(message, basestring):\r\n                            value = message\r\n                            message = message.get('message')\r\n                    else:\r\n                        message = value.get('message', None)\r\n                except ValueError:\r\n                    pass\r\n\r\n        exception_class = ErrorInResponseException\r\n        if status in ErrorCode.NO_SUCH_ELEMENT:\r\n            exception_class = NoSuchElementException\r\n        elif status in ErrorCode.NO_SUCH_FRAME:\r\n            exception_class = NoSuchFrameException\r\n        elif status in ErrorCode.NO_SUCH_WINDOW:\r\n            exception_class = NoSuchWindowException\r\n        elif status in ErrorCode.STALE_ELEMENT_REFERENCE:\r\n            exception_class = StaleElementReferenceException\r\n        elif status in ErrorCode.ELEMENT_NOT_VISIBLE:\r\n            exception_class = ElementNotVisibleException\r\n        elif status in ErrorCode.INVALID_ELEMENT_STATE:\r\n            exception_class = InvalidElementStateException\r\n        elif status in ErrorCode.INVALID_SELECTOR \\\r\n                or status in ErrorCode.INVALID_XPATH_SELECTOR \\\r\n                or status in ErrorCode.INVALID_XPATH_SELECTOR_RETURN_TYPER:\r\n            exception_class = InvalidSelectorException\r\n        elif status in ErrorCode.ELEMENT_IS_NOT_SELECTABLE:\r\n            exception_class = ElementNotSelectableException\r\n        elif status in ErrorCode.ELEMENT_NOT_INTERACTABLE:\r\n            exception_class = ElementNotInteractableException\r\n        elif status in ErrorCode.INVALID_COOKIE_DOMAIN:\r\n            exception_class = InvalidCookieDomainException\r\n        elif status in ErrorCode.UNABLE_TO_SET_COOKIE:\r\n            exception_class = UnableToSetCookieException\r\n        elif status in ErrorCode.TIMEOUT:\r\n            exception_class = TimeoutException\r\n        elif status in ErrorCode.SCRIPT_TIMEOUT:\r\n            exception_class = TimeoutException\r\n        elif status in ErrorCode.UNKNOWN_ERROR:\r\n            exception_class = WebDriverException\r\n        elif status in ErrorCode.UNEXPECTED_ALERT_OPEN:\r\n            exception_class = UnexpectedAlertPresentException\r\n        elif status in ErrorCode.NO_ALERT_OPEN:\r\n            exception_class = NoAlertPresentException\r\n        elif status in ErrorCode.IME_NOT_AVAILABLE:\r\n            exception_class = ImeNotAvailableException\r\n        elif status in ErrorCode.IME_ENGINE_ACTIVATION_FAILED:\r\n            exception_class = ImeActivationFailedException\r\n        elif status in ErrorCode.MOVE_TARGET_OUT_OF_BOUNDS:\r\n            exception_class = MoveTargetOutOfBoundsException\r\n        elif status in ErrorCode.JAVASCRIPT_ERROR:\r\n            exception_class = JavascriptException\r\n        elif status in ErrorCode.SESSION_NOT_CREATED:\r\n            exception_class = SessionNotCreatedException\r\n        elif status in ErrorCode.INVALID_ARGUMENT:\r\n            exception_class = InvalidArgumentException\r\n        elif status in ErrorCode.NO_SUCH_COOKIE:\r\n            exception_class = NoSuchCookieException\r\n        elif status in ErrorCode.UNABLE_TO_CAPTURE_SCREEN:\r\n            exception_class = ScreenshotException\r\n        elif status in ErrorCode.ELEMENT_CLICK_INTERCEPTED:\r\n            exception_class = ElementClickInterceptedException\r\n        elif status in ErrorCode.INSECURE_CERTIFICATE:\r\n            exception_class = InsecureCertificateException\r\n        elif status in ErrorCode.INVALID_COORDINATES:\r\n            exception_class = InvalidCoordinatesException\r\n        elif status in ErrorCode.INVALID_SESSION_ID:\r\n            exception_class = InvalidSessionIdException\r\n        elif status in ErrorCode.UNKNOWN_METHOD:\r\n            exception_class = UnknownMethodException\r\n        else:\r\n            exception_class = WebDriverException\r\n        if value == '' or value is None:\r\n            value = response['value']\r\n        if isinstance(value, basestring):\r\n            if exception_class == ErrorInResponseException:\r\n                raise exception_class(response, value)\r\n            raise exception_class(value)\r\n        if message == \"\" and 'message' in value:\r\n            message = value['message']\r\n\r\n        screen = None\r\n        if 'screen' in value:\r\n            screen = value['screen']\r\n\r\n        stacktrace = None\r\n        if 'stackTrace' in value and value['stackTrace']:\r\n            stacktrace = []\r\n            try:\r\n                for frame in value['stackTrace']:\r\n                    line = self._value_or_default(frame, 'lineNumber', '')\r\n                    file = self._value_or_default(frame, 'fileName', '<anonymous                                >')\r\n                    if line:\r\n                        file = \"%s:%s\" % (file, line)\r\n                    meth = self._value_or_default(frame, 'methodName', '<anonymo                                us>')\r\n                    if 'className' in frame:\r\n                        meth = \"%s.%s\" % (frame['className'], meth)\r\n                    msg = \"    at %s (%s)\"\r\n                    msg = msg % (meth, file)\r\n                    stacktrace.append(msg)\r\n            except TypeError:\r\n                pass\r\n        if exception_class == ErrorInResponseException:\r\n            raise exception_class(response, message)\r\n        elif exception_class == UnexpectedAlertPresentException:\r\n            alert_text = None\r\n            if 'data' in value:\r\n                alert_text = value['data'].get('text')\r\n            elif 'alert' in value:\r\n                alert_text = value['alert'].get('text')\r\n            raise exception_class(message, screen, stacktrace, alert_text)\r\n>       raise exception_class(message, screen, stacktrace)\r\nE       selenium.common.exceptions.InvalidSelectorException: Message: invalid se                                lector: Compound class names not permitted\r\nE         (Session info: chrome=66.0.3359.181)\r\nE         (Driver info: chromedriver=2.38.552522 (437e6fbedfa8762dec75e2c5b3ddb8                                6763dc9dcb),platform=Windows NT 6.1.7601 SP1 x86_64)\r\n\r\nc:\\program files (x86)\\python36-32\\lib\\site-packages\\selenium\\webdriver\\remote\\e                                rrorhandler.py:242: InvalidSelectorException\r\n==================== 2 failed, 1 passed in 143.71 seconds =====================\r\n```"},"comment":{"url":"https://api.github.com/repos/frlp-utn-is-2018/orderingg/issues/comments/392342418","html_url":"https://github.com/frlp-utn-is-2018/orderingg/issues/61#issuecomment-392342418","issue_url":"https://api.github.com/repos/frlp-utn-is-2018/orderingg/issues/61","id":392342418,"user":{"login":"RodrigoJacznik","id":2715743,"avatar_url":"https://avatars0.githubusercontent.com/u/2715743?v=4","gravatar_id":"","url":"https://api.github.com/users/RodrigoJacznik","html_url":"https://github.com/RodrigoJacznik","followers_url":"https://api.github.com/users/RodrigoJacznik/followers","following_url":"https://api.github.com/users/RodrigoJacznik/following{/other_user}","gists_url":"https://api.github.com/users/RodrigoJacznik/gists{/gist_id}","starred_url":"https://api.github.com/users/RodrigoJacznik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RodrigoJacznik/subscriptions","organizations_url":"https://api.github.com/users/RodrigoJacznik/orgs","repos_url":"https://api.github.com/users/RodrigoJacznik/repos","events_url":"https://api.github.com/users/RodrigoJacznik/events{/privacy}","received_events_url":"https://api.github.com/users/RodrigoJacznik/received_events","type":"User","site_admin":false},"created_at":"2018-05-27T15:57:52Z","updated_at":"2018-05-27T15:57:52Z","author_association":"CONTRIBUTOR","body":"No tenías que modificar eso.\r\nLo que estaba mal era el selector. La función Select hace otra cosa.\r\nFíjate de leer un poco la documentación antes de modificar y postear en la issue"}}
{"actor":{"display_login":"RodrigoJacznik"}}