test_point_collection.py 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. import logging
  2. import unittest
  3. from plat.deepcoin.point_collection import PointCollection
  4. logging.basicConfig(level=logging.INFO, force=True) # 设置日志级别
  5. class MyTestCase(unittest.TestCase):
  6. def setUp(self):
  7. self.pc = PointCollection('127.0.0.1:6555')
  8. def test_to_top_swipe(self):
  9. """
  10. 滑动到顶部
  11. """
  12. self.pc.to_top_swipe()
  13. def test_to_next_swipe(self):
  14. """
  15. 滑动到下一屏
  16. """
  17. self.pc.to_next_swipe()
  18. def test_save_point(self):
  19. """
  20. 保存坐标
  21. """
  22. self.pc.save_point()
  23. def test_slider_baozhengjin(self):
  24. """
  25. 保证金滑块
  26. """
  27. self.pc.slider_baozhengjin()
  28. def test_click_kaicang(self):
  29. """
  30. 开仓
  31. """
  32. self.pc.click_kaicang()
  33. def test_click_pingchang(self):
  34. """
  35. 平仓
  36. """
  37. self.pc.click_pingchang()
  38. def test_select_weituo_xianjia(self):
  39. """
  40. 选择限价委托
  41. """
  42. self.pc.select_weituo_xianjia()
  43. def test_click_price(self):
  44. """
  45. 点击价格
  46. """
  47. self.pc.click_price_red()
  48. def test_f1(self):
  49. """
  50. f1 开仓界面,仓位滑竿百分比(30-60)
  51. """
  52. self.pc.click_kaicang()
  53. self.pc.slider_baozhengjin()
  54. def test_f2(self):
  55. """
  56. f2 确认开仓,限价职中间数值
  57. 检查撤销限价委托单
  58. """
  59. def test_f3(self):
  60. """
  61. F3 开仓界面,仓位滑竿百分比(30-60)确认开仓,限价职中间数值
  62. """
  63. def test_f4(self):
  64. """
  65. F4 确认开仓限价职中间数值 检查撤销限价委托单
  66. """
  67. def test_f5(self):
  68. """
  69. F5 开仓界面胂仓位滑竿百分比(30-60)
  70. """
  71. def test_f6(self):
  72. """
  73. F6 确认开仓,限价职中间数值
  74. 检查撤销限价委托单
  75. """
  76. def test_f7(self):
  77. """
  78. F7 平仓界面二仓位滑竿百分比(90-100)
  79. """
  80. def test_f8(self):
  81. """
  82. F8 确认平仓,限价职中间数值
  83. 检查撤销限价委托单
  84. """
  85. def test_jiao_yi(self):
  86. x, y = self.pc.btn_jiao_yi()
  87. logging.info(f"交易坐标: ({x},{y})")
  88. def test_mairu_kaiduo(self):
  89. x, y = self.pc.btn_mairu_kaiduo()
  90. logging.info(f"买入开多: ({x},{y})")
  91. def test_chichang(self):
  92. self.pc.d.xpath()
  93. if __name__ == '__main__':
  94. unittest.main()