Hi need some help on how to fixed the error messages
E fixture 'test_login' not found
> available fixtures: cache, capfd, capfdbinary, caplog, capsys, capsysbinary, doctest_namespace, metadata, monkeypatch, pytestbdd_given_User logged into application, pytestbdd_given_trace, pytestbdd_then_trace, pytestbdd_when_trace, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory, trace
> use 'pytest --fixtures [testpath]' for help on them.
This is my test_login.py
from pytest_bdd import scenario, given, when, then
from appium.webdriver.common.touch_action import TouchAction
from appium import webdriver
import pytest
import os
@scenario('../features/test.feature', 'Login scene')
def test_add():
pass
class TestLogin:
host = 'http://localhost:4723/wd/hub'
desired_capabilities={
'platformName': 'Android',
'deviceName': 'Galaxy J7 Pro',
'platformVersion': '9',
'appPackage': 'com.beaheromobile',
'appActivity': 'com.beaheromobile.MainActivity',
'udid': '52002b7fb8eb8489',
'adbExecTimeout': 120000,
}
credentials={
'email': '[email protected]',
'password': '123456'
}
driver = webdriver.Remote(host, desired_capabilities)
action = TouchAction(driver)
@given('User logged into application')
def test_login(self):
self.driver
self.driver.implicitly_wait(8000)
loginbtn = self.driver.find_element_by_xpath('/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup[3]/android.widget.TextView')
self.action.tap(loginbtn).perform()
self.driver.implicitly_wait(3000)
and this is my test.feature
Feature: Login
A test login
Scenario: Login scene
Given User logged into application