最快最便捷的pytest使用allure测试报告

news2024/11/27 12:34:09

一、前言

最近通过群友了解到了allure这个报告,开始还不以为然,但还是逃不过真香定律。

经过试用之后,发现这个报告真的很好,很适合自动化测试结果的展示。下面说说我的探索历程吧。

  • 选用的项目为Selenium自动化测试Pytest框架实战,在这个项目的基础上说allure报告。

二、allure安装

  • 首先安装python的allure-pytest包
<span style="color:#596172"><span style="background-color:#ffffff"><code class="language-shell">pip install allure-pytest
</code></span></span>
  • 然后安装allure的command命令行程序

MacOS直接使用homebrew工具执行 brew install allure 即可安装,不用配置下载包和配置环境

在GitHub下载安装程序https://github.com/allure-framework/allure2/releases

但是由于GitHub访问太慢,我已经下载好并放在了群文件里面

下载完成后解压放到一个文件夹。我的路径是D:\Program Files\allure-2.13.3

然后配置环境变量: 在系统变量path中添加D:\Program Files\allure-2.13.3\bin,然后确定保存。

打开cmd,输入allure,如果结果显示如下则表示成功了:

<span style="color:#596172"><span style="background-color:#ffffff"><code class="language-powershell">C:\Users\hoou>allure
Usage: allure [<span style="color:#d19a66">options</span>] [<span style="color:#d19a66">command</span>] [<span style="color:#d19a66">command</span> <span style="color:#d19a66">options</span>]
  Options:
    <span style="color:#56b6c2">--help</span>
      Print commandline help.
    <span style="color:#56b6c2">-q</span>, <span style="color:#56b6c2">--quiet</span>
      <span style="color:#7171bf">Switch</span> on the quiet mode.
      Default: false
    <span style="color:#56b6c2">-v</span>, <span style="color:#56b6c2">--verbose</span>
      <span style="color:#7171bf">Switch</span> on the verbose mode.
      Default: false
    <span style="color:#56b6c2">--version</span>
      Print commandline version.
      Default: false
  Commands:
    generate      Generate the report
      Usage: generate [<span style="color:#d19a66">options</span>] The directories with allure results
        Options:
          <span style="color:#56b6c2">-c</span>, <span style="color:#56b6c2">--clean</span>
            Clean Allure report directory before generating a new one.
            Default: false
          <span style="color:#56b6c2">--config</span>
            Allure commandline config path. <span style="color:#7171bf">If</span> specified overrides values from
            <span style="color:#56b6c2">--profile</span> and <span style="color:#56b6c2">--configDirectory</span>.
          <span style="color:#56b6c2">--configDirectory</span>
            Allure commandline configurations directory. By default uses
            ALLURE_HOME directory.
          <span style="color:#56b6c2">--profile</span>
            Allure commandline configuration profile.
          <span style="color:#56b6c2">-o</span>, <span style="color:#56b6c2">--report-dir</span>, <span style="color:#56b6c2">--output</span>
            The directory to generate Allure report into.
            Default: allure<span style="color:#56b6c2">-report</span>

    serve      Serve the report
      Usage: serve [<span style="color:#d19a66">options</span>] The directories with allure results
        Options:
          <span style="color:#56b6c2">--config</span>
            Allure commandline config path. <span style="color:#7171bf">If</span> specified overrides values from
            <span style="color:#56b6c2">--profile</span> and <span style="color:#56b6c2">--configDirectory</span>.
          <span style="color:#56b6c2">--configDirectory</span>
            Allure commandline configurations directory. By default uses
            ALLURE_HOME directory.
          <span style="color:#56b6c2">-h</span>, <span style="color:#56b6c2">--host</span>
            This host will be used to <span style="color:#7171bf">start</span> web server <span style="color:#7171bf">for</span> the report.
          <span style="color:#56b6c2">-p</span>, <span style="color:#56b6c2">--port</span>
            This port will be used to <span style="color:#7171bf">start</span> web server <span style="color:#7171bf">for</span> the report.
            Default: <span style="color:#d19a66">0</span>
          <span style="color:#56b6c2">--profile</span>
            Allure commandline configuration profile.

    open      Open generated report
      Usage: open [<span style="color:#d19a66">options</span>] The report directory
        Options:
          <span style="color:#56b6c2">-h</span>, <span style="color:#56b6c2">--host</span>
            This host will be used to <span style="color:#7171bf">start</span> web server <span style="color:#7171bf">for</span> the report.
          <span style="color:#56b6c2">-p</span>, <span style="color:#56b6c2">--port</span>
            This port will be used to <span style="color:#7171bf">start</span> web server <span style="color:#7171bf">for</span> the report.
            Default: <span style="color:#d19a66">0</span>

    plugin      Generate the report
      Usage: plugin [<span style="color:#d19a66">options</span>]
        Options:
          <span style="color:#56b6c2">--config</span>
            Allure commandline config path. <span style="color:#7171bf">If</span> specified overrides values from
            <span style="color:#56b6c2">--profile</span> and <span style="color:#56b6c2">--configDirectory</span>.
          <span style="color:#56b6c2">--configDirectory</span>
            Allure commandline configurations directory. By default uses
            ALLURE_HOME directory.
          <span style="color:#56b6c2">--profile</span>
            Allure commandline configuration profile.
</code></span></span>

三、allure初体验

改造一下之前的测试用例代码

<span style="color:#596172"><span style="background-color:#ffffff"><code class="language-python"><span style="color:#5c6370"><em>#!/usr/bin/env python3</em></span>
<span style="color:#5c6370"><em># -*- coding:utf-8 -*-</em></span>
<span style="color:#7171bf">import</span> re
<span style="color:#7171bf">import</span> pytest
<span style="color:#7171bf">import</span> allure
<span style="color:#7171bf">from</span> utils.logger <span style="color:#7171bf">import</span> log
<span style="color:#7171bf">from</span> common.readconfig <span style="color:#7171bf">import</span> ini
<span style="color:#7171bf">from</span> page_object.searchpage <span style="color:#7171bf">import</span> SearchPage


<span style="color:#61aeee">@allure.feature(<span style="color:#3388aa">"测试百度模块"</span>)</span>
<span style="color:#7171bf">class</span> <span style="color:#61aeee">TestSearch</span>:
<span style="color:#61aeee">    @pytest.fixture(scope=<span style="color:#3388aa">'function'</span>, autouse=<span style="color:#56b6c2">True</span>)</span>
    <span style="color:#7171bf">def</span> <span style="color:#61aeee">open_baidu</span>(self, drivers):
        <span style="color:#98c379">"""打开百度"""</span>
        search = SearchPage(drivers)
        search.get_url(ini.url)

<span style="color:#61aeee">    @allure.story(<span style="color:#3388aa">"搜索selenium结果用例"</span>)</span>
    <span style="color:#7171bf">def</span> <span style="color:#61aeee">test_001</span>(self, drivers):
        <span style="color:#98c379">"""搜索"""</span>
        search = SearchPage(drivers)
        search.input_search(<span style="color:#98c379">"selenium"</span>)
        search.click_search()
        result = re.search(<span style="color:#98c379">r'selenium'</span>, search.get_source)
        log.info(result)
        <span style="color:#7171bf">assert</span> result

<span style="color:#61aeee">    @allure.story(<span style="color:#3388aa">"测试搜索候选用例"</span>)</span>
    <span style="color:#7171bf">def</span> <span style="color:#61aeee">test_002</span>(self, drivers):
        <span style="color:#98c379">"""测试搜索候选"""</span>
        search = SearchPage(drivers)
        search.input_search(<span style="color:#98c379">"selenium"</span>)
        log.info(<span style="color:#7171bf">list</span>(search.imagine))
        <span style="color:#7171bf">assert</span> <span style="color:#7171bf">all</span>([<span style="color:#98c379">"selenium"</span> <span style="color:#7171bf">in</span> i <span style="color:#7171bf">for</span> i <span style="color:#7171bf">in</span> search.imagine])
        
<span style="color:#7171bf">if</span> __name__ == <span style="color:#98c379">'__main__'</span>:
    pytest.main([<span style="color:#98c379">'TestCase/test_search.py'</span>, <span style="color:#98c379">'--alluredir'</span>, <span style="color:#98c379">'./allure'</span>])
    os.system(<span style="color:#98c379">'allure serve allure'</span>)
</code></span></span>

然后运行一下:

注意:如果你使用的是pycharm编辑器,请跳过该运行方式,直接使用.bat.sh的方式运行

<span style="color:#596172"><span style="background-color:#ffffff"><code class="language-shell">***


------------------------------- generated html file: file://C:\Users\hoou\PycharmProjects\web-demotest\report.html -------------------------------- 

Results (12.97s):
       2 passed
Generating report to temp directory...
Report successfully generated to C:\Users\hoou\AppData\Local\Temp\112346119265936111\allure-report
Starting web server...
2020-06-18 22:52:44.500:INFO::main: Logging initialized @1958ms to org.eclipse.jetty.util.log.StdErrLog
Server started at <http://172.18.47.241:6202/>. Press <Ctrl+C> to exit
</code></span></span>

命令行会出现如上提示,接着浏览器会自动打开:

点击左下角En即可选择切换为中文。

是不是很清爽很友好,比pytest-html更舒服。

四、allure装饰器介绍

五、报告的生成和展示

刚才的两个命令:

  • 生成allure原始报告到report/allure目录下,生成的全部为json或txt文件。
<span style="color:#596172"><span style="background-color:#ffffff"><code class="language-powershell">pytest TestCase/test_search.py <span style="color:#56b6c2">--alluredir</span> ./allure
</code></span></span>
  • 在一个临时文件中生成报告并启动浏览器打开
<span style="color:#596172"><span style="background-color:#ffffff"><code class="language-powershell">allure serve allure
</code></span></span>

但是在关闭浏览器之后这个报告就再也打不开了。不建议使用这种。

所以我们必须使用其他的命令,让allure可以指定生成的报告目录。

我们在项目的根目录中创建run_case.py文件,内容如下:

<span style="color:#596172"><span style="background-color:#ffffff"><code class="language-python"><span style="color:#5c6370"><em>#!/usr/bin/env python3</em></span>
<span style="color:#5c6370"><em># -*- coding:utf-8 -*-</em></span>
<span style="color:#7171bf">import</span> sys
<span style="color:#7171bf">import</span> subprocess

WIN = sys.platform.startswith(<span style="color:#98c379">'win'</span>)


<span style="color:#7171bf">def</span> <span style="color:#61aeee">main</span>():
   <span style="color:#98c379">"""主函数"""</span>
   steps = [
       <span style="color:#98c379">"venv\\Script\\activate"</span> <span style="color:#7171bf">if</span> WIN <span style="color:#7171bf">else</span> <span style="color:#98c379">"source venv/bin/activate"</span>,
       <span style="color:#98c379">"pytest --alluredir allure-results --clean-alluredir"</span>,
       <span style="color:#98c379">"allure generate allure-results -c -o allure-report"</span>,
       <span style="color:#98c379">"allure open allure-report"</span>
   ]
   <span style="color:#7171bf">for</span> step <span style="color:#7171bf">in</span> steps:
       subprocess.run(<span style="color:#98c379">"call "</span> + step <span style="color:#7171bf">if</span> WIN <span style="color:#7171bf">else</span> step, shell=<span style="color:#56b6c2">True</span>)


<span style="color:#7171bf">if</span> __name__ == <span style="color:#98c379">"__main__"</span>:
   main()
</code></span></span>

命令释义:

1、使用pytest生成原始报告,里面大多数是一些原始的json数据,加入--clean-alluredir参数清除allure-results历史数据。

<span style="color:#596172"><span style="background-color:#ffffff"><code class="language-powershell">pytest <span style="color:#56b6c2">--alluredir</span> allure<span style="color:#56b6c2">-results</span> <span style="color:#56b6c2">--clean-alluredir</span>
</code></span></span>
  • --clean-alluredir 清除allure-results历史数据

2、使用generate命令导出HTML报告到新的目录

<span style="color:#596172"><span style="background-color:#ffffff"><code class="language-powershell">allure generate allure<span style="color:#56b6c2">-results</span> <span style="color:#56b6c2">-o</span> allure<span style="color:#56b6c2">-report</span>
</code></span></span>
  • -c 在生成报告之前先清理之前的报告目录
  • -o 指定生成报告的文件夹

3、使用open命令在浏览器中打开HTML报告

<span style="color:#596172"><span style="background-color:#ffffff"><code class="language-powershell">allure open allure<span style="color:#56b6c2">-report</span>
</code></span></span>

好了我们运行一下该文件。

<span style="color:#596172"><span style="background-color:#ffffff"><code class="language-powershell">Results (<span style="color:#d19a66">12.85</span>s):
       <span style="color:#d19a66">2</span> passed
Report successfully generated to c:\Users\hoou\PycharmProjects\web<span style="color:#56b6c2">-demotest</span>\allure<span style="color:#56b6c2">-report</span>
Starting web server...
<span style="color:#d19a66">2020</span><span style="color:#56b6c2">-06-18</span> <span style="color:#d19a66">23</span>:<span style="color:#d19a66">30</span>:<span style="color:#d19a66">24.122</span>:INFO::main: Logging initialized @<span style="color:#d19a66">260</span>ms to org.eclipse.jetty.util.log.StdErrLog
Server started at <http://<span style="color:#d19a66">172.18</span>.<span style="color:#d19a66">47.241</span>:<span style="color:#d19a66">7932</span>/>. Press <Ctrl+C> to <span style="color:#7171bf">exit</span>
</code></span></span>

可以看到运行成功了。

在项目中的allure-report文件夹也生成了相应的报告。

六、allure发生错误截图

上面的用例全是运行成功的,没有错误和失败的,那么发生了错误怎么样在allure报告中生成错误截图呢,我们一起来看看。

首先我们先在config/conf.py文件中添加一个截图目录和截图文件的配置。

<span style="color:#596172"><span style="background-color:#ffffff"><code class="language-python">+++

<span style="color:#7171bf">class</span> <span style="color:#61aeee">ConfigManager</span>(<span style="color:#61aeee">object</span>):

		...
    
<span style="color:#61aeee">    @property</span>
    <span style="color:#7171bf">def</span> <span style="color:#61aeee">screen_path</span>(self):
        <span style="color:#98c379">"""截图目录"""</span>
        screenshot_dir = os.path.join(self.BASE_DIR, <span style="color:#98c379">'screen_capture'</span>)
        <span style="color:#7171bf">if</span> <span style="color:#7171bf">not</span> os.path.exists(screenshot_dir):
            os.makedirs(screenshot_dir)
        now_time = dt_strftime(<span style="color:#98c379">"%Y%m%d%H%M%S"</span>)
        screen_file = os.path.join(screenshot_dir, <span style="color:#98c379">"{}.png"</span>.<span style="color:#7171bf">format</span>(now_time))
        <span style="color:#7171bf">return</span> now_time, screen_file
	
  	...
+++
</code></span></span>

然后我们修改项目目录中的conftest.py

<span style="color:#596172"><span style="background-color:#ffffff"><code class="language-python"><span style="color:#5c6370"><em>#!/usr/bin/env python3</em></span>
<span style="color:#5c6370"><em># -*- coding:utf-8 -*-</em></span>
<span style="color:#7171bf">import</span> base64
<span style="color:#7171bf">import</span> pytest
<span style="color:#7171bf">import</span> allure
<span style="color:#7171bf">from</span> py.xml <span style="color:#7171bf">import</span> html
<span style="color:#7171bf">from</span> selenium <span style="color:#7171bf">import</span> webdriver

<span style="color:#7171bf">from</span> config.conf <span style="color:#7171bf">import</span> cm
<span style="color:#7171bf">from</span> common.readconfig <span style="color:#7171bf">import</span> ini
<span style="color:#7171bf">from</span> utils.times <span style="color:#7171bf">import</span> timestamp
<span style="color:#7171bf">from</span> utils.send_mail <span style="color:#7171bf">import</span> send_report

driver = <span style="color:#56b6c2">None</span>


<span style="color:#61aeee">@pytest.fixture(scope=<span style="color:#3388aa">'session'</span>, autouse=<span style="color:#56b6c2">True</span>)</span>
<span style="color:#7171bf">def</span> <span style="color:#61aeee">drivers</span>(request):
    <span style="color:#7171bf">global</span> driver
    <span style="color:#7171bf">if</span> driver <span style="color:#7171bf">is</span> <span style="color:#56b6c2">None</span>:
        driver = webdriver.Chrome()
        driver.maximize_window()

    <span style="color:#7171bf">def</span> <span style="color:#61aeee">fn</span>():
        driver.quit()

    request.addfinalizer(fn)
    <span style="color:#7171bf">return</span> driver


<span style="color:#61aeee">@pytest.hookimpl(hookwrapper=<span style="color:#56b6c2">True</span>)</span>
<span style="color:#7171bf">def</span> <span style="color:#61aeee">pytest_runtest_makereport</span>(item):
    <span style="color:#98c379">"""
    当测试失败的时候,自动截图,展示到html报告中
    :param item:
    """</span>
    pytest_html = item.config.pluginmanager.getplugin(<span style="color:#98c379">'html'</span>)
    outcome = <span style="color:#7171bf">yield</span>
    report = outcome.get_result()
    report.description = <span style="color:#7171bf">str</span>(item.function.__doc__)
    extra = <span style="color:#7171bf">getattr</span>(report, <span style="color:#98c379">'extra'</span>, [])

    <span style="color:#7171bf">if</span> report.when == <span style="color:#98c379">'call'</span> <span style="color:#7171bf">or</span> report.when == <span style="color:#98c379">"setup"</span>:
        xfail = <span style="color:#7171bf">hasattr</span>(report, <span style="color:#98c379">'wasxfail'</span>)
        <span style="color:#7171bf">if</span> (report.skipped <span style="color:#7171bf">and</span> xfail) <span style="color:#7171bf">or</span> (report.failed <span style="color:#7171bf">and</span> <span style="color:#7171bf">not</span> xfail):
            screen_img = _capture_screenshot()
            <span style="color:#7171bf">if</span> screen_img:
                html = <span style="color:#98c379">'<div><img src="data:image/png;base64,%s" alt="screenshot" style="width:1024px;height:768px;" '</span> \
                       <span style="color:#98c379">'onclick="window.open(this.src)" align="right"/></div>'</span> % screen_img
                extra.append(pytest_html.extras.html(html))
        report.extra = extra


<span style="color:#7171bf">def</span> <span style="color:#61aeee">pytest_html_results_table_header</span>(cells):
    cells.insert(<span style="color:#d19a66">1</span>, html.th(<span style="color:#98c379">'用例名称'</span>))
    cells.insert(<span style="color:#d19a66">2</span>, html.th(<span style="color:#98c379">'Test_nodeid'</span>))
    cells.pop(<span style="color:#d19a66">2</span>)


<span style="color:#7171bf">def</span> <span style="color:#61aeee">pytest_html_results_table_row</span>(report, cells):
    cells.insert(<span style="color:#d19a66">1</span>, html.td(report.description))
    cells.insert(<span style="color:#d19a66">2</span>, html.td(report.nodeid))
    cells.pop(<span style="color:#d19a66">2</span>)


<span style="color:#7171bf">def</span> <span style="color:#61aeee">pytest_html_results_table_html</span>(report, data):
    <span style="color:#7171bf">if</span> report.passed:
        <span style="color:#7171bf">del</span> data[:]
        data.append(html.div(<span style="color:#98c379">'通过的用例未捕获日志输出.'</span>, class_=<span style="color:#98c379">'empty log'</span>))


<span style="color:#7171bf">def</span> <span style="color:#61aeee">pytest_html_report_title</span>(report):
    report.title = <span style="color:#98c379">"pytest示例项目测试报告"</span>


<span style="color:#7171bf">def</span> <span style="color:#61aeee">pytest_configure</span>(config):
    config._metadata.clear()
    config._metadata[<span style="color:#98c379">'测试项目'</span>] = <span style="color:#98c379">"测试百度官网搜索"</span>
    config._metadata[<span style="color:#98c379">'测试地址'</span>] = ini.url


<span style="color:#7171bf">def</span> <span style="color:#61aeee">pytest_html_results_summary</span>(prefix, summary, postfix):
    <span style="color:#5c6370"><em># prefix.clear() # 清空summary中的内容</em></span>
    prefix.extend([html.p(<span style="color:#98c379">"所属部门: XX公司测试部"</span>)])
    prefix.extend([html.p(<span style="color:#98c379">"测试执行人: 随风挥手"</span>)])


<span style="color:#7171bf">def</span> <span style="color:#61aeee">pytest_terminal_summary</span>(terminalreporter, exitstatus, config):
    <span style="color:#98c379">"""收集测试结果"""</span>
    result = {
        <span style="color:#98c379">"total"</span>: terminalreporter._numcollected,
        <span style="color:#98c379">'passed'</span>: <span style="color:#7171bf">len</span>(terminalreporter.stats.get(<span style="color:#98c379">'passed'</span>, [])),
        <span style="color:#98c379">'failed'</span>: <span style="color:#7171bf">len</span>(terminalreporter.stats.get(<span style="color:#98c379">'failed'</span>, [])),
        <span style="color:#98c379">'error'</span>: <span style="color:#7171bf">len</span>(terminalreporter.stats.get(<span style="color:#98c379">'error'</span>, [])),
        <span style="color:#98c379">'skipped'</span>: <span style="color:#7171bf">len</span>(terminalreporter.stats.get(<span style="color:#98c379">'skipped'</span>, [])),
        <span style="color:#5c6370"><em># terminalreporter._sessionstarttime 会话开始时间</em></span>
        <span style="color:#98c379">'total times'</span>: timestamp() - terminalreporter._sessionstarttime
    }
    <span style="color:#7171bf">print</span>(result)
    <span style="color:#7171bf">if</span> result[<span style="color:#98c379">'failed'</span>] <span style="color:#7171bf">or</span> result[<span style="color:#98c379">'error'</span>]:
        send_report()


<span style="color:#7171bf">def</span> <span style="color:#61aeee">_capture_screenshot</span>():
    <span style="color:#98c379">"""截图保存为base64"""</span>
    now_time, screen_file = cm.screen_path
    driver.save_screenshot(screen_file)
    allure.attach.file(screen_file,
                       <span style="color:#98c379">"失败截图{}"</span>.<span style="color:#7171bf">format</span>(now_time),
                       allure.attachment_type.PNG)
    <span style="color:#7171bf">with</span> <span style="color:#7171bf">open</span>(screen_file, <span style="color:#98c379">'rb'</span>) <span style="color:#7171bf">as</span> f:
        imagebase64 = base64.b64encode(f.read())
    <span style="color:#7171bf">return</span> imagebase64.decode()
</code></span></span>

来看看我们修改了什么:

  • 我们修改了_capture_screenshot函数

在里面我们使用了webdriver截图生成文件,并使用allure.attach.file方法将文件添加到了allure测试报告中。

并且我们还返回了图片的base64编码,这样可以让pytest-html的错误截图和allure都能生效。

运行一次得到两份报告,一份是简单的一份是好看内容丰富的。

现在我们在测试用例中构建一个预期的错误测试一个我们的这个代码。


修改test_002测试用例

<span style="color:#596172"><span style="background-color:#ffffff"><code class="language-python">        <span style="color:#7171bf">assert</span> <span style="color:#7171bf">not</span> <span style="color:#7171bf">all</span>([<span style="color:#98c379">"selenium"</span> <span style="color:#7171bf">in</span> i <span style="color:#7171bf">for</span> i <span style="color:#7171bf">in</span> search.imagine])
</code></span></span>

运行一下:

可以看到allure报告中已经有了这个错误的信息。

再来看看pytest-html中生成的报告:

可以看到两份生成的报告都附带了错误的截图,真是鱼和熊掌可以兼得呢。

好了,到这里可以说allure的报告就先到这里了,以后发现allure其他的精彩之处我再来分享。

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/49855.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

Day1使用Burpsuite抓包工具抓包,改变UA头使得手机和pc端界面互相转换

1.前期工作&#xff1a;安装Burpsuite工具这里网上有许多教程&#xff0c;大致步骤如下&#xff1a; 找到安装包然后解压缩&#xff0c;然后双击 安装jdk&#xff0c;然后就是配置环境变量&#xff0c;如果是默认jdk安装路径没有更改路径的话就是跟如下一样 配置如下&#xff…

跨平台开发方案的三个时代

跨平台开发从本质上讲是为了增加业务代码的复用率&#xff0c;减少因为要适配多个平台带来的工作量&#xff0c;从而降低开发成本。在提高业务专注度的同时&#xff0c;能够为用户提供一致的用户体验&#xff0c;实现“多快好省”的效果。 跨平台是跨哪些平台&#xff1f;怎么…

高视医疗在港交所招股:IPO募资要用于贷款,高铁塔为控股股东

11月30日&#xff0c;高视医疗&#xff08;HK:02407&#xff09;在港交所发布公告&#xff0c;拟全球发售1306.86万股股份&#xff0c;其中香港发售股份130.7万股&#xff0c;国际发售股份1176.16万股&#xff0c;另有15%超额配股权&#xff0c;于2022年11月30日至12月5日招股&…

Talk预告 | 亚马逊云科技上海人工智能研究院肖天骏:基于视频的自监督物体遮挡补全分割

本期为TechBeat人工智能社区第458期线上Talk&#xff01; 北京时间11月30日(周三)20:00&#xff0c;亚马逊云科技上海人工智能研究院资深应用科学家——肖天骏的Talk将准时在TechBeat人工智能社区开播&#xff01; 他与大家分享的主题是: “基于视频的自监督物体遮挡补全分割”…

请求和响应

目录1 请求对象1.1 请求对象介绍1.2 请求对象常用方法-获取各自路径1.3 请求对象常用方法-获取请求头信息1.4 请求对象常用方法-请求参数信息1.5 获取请求参数并封装对象1.5.1 手动封装方式1.5.2 反射封装方式1.5.3 工具类封装方式1.6 流对象获取请求信息1.7 中文乱码问题1.8 请…

可发生点击化学反应:1458576-00-5,Biotin-PEG4-alkyne,生物素-四聚乙二醇-炔

【中文名称】生物素-四聚乙二醇-炔&#xff0c;生物素-四聚乙二醇-丙炔基 【英文名称】 Biotin-PEG4-alkyne 【货号】Y-PE-2172 【CAS】1458576-00-5 【分子式】C21H35N3O6S 【分子量】457.58 【基团】alkyne 【纯度】95% 【规格】25mg&#xff0c;100mg&#xff0c;250mg 【是…

如何应对继承的双面性

如何应对继承的双面性 继承既强大又有破坏性&#xff0c;那怎么办呢&#xff1f; 1&#xff09;避免使用继承&#xff1b; 2&#xff09;正确使用继承。 我们先来看怎么避免继承&#xff0c;有三种方法&#xff1a; 使用final关键字&#xff1b; 优先使用组合而非继承&#…

11月30日:linux服务器安装以及部署项目

准备一个连接linux服务器的可视化工具&#xff0c;开始发车 推荐使用国产&#xff1a; finalshell 下载地址&#xff1a;FinalShell SSH工具,服务器管理,远程桌面加速软件,支持Windows,macOS,Linux,版本3.9.7,更新时间2022.10.26 - SSH工具 SSH客户端 xshell&#xff1a;安装…

Spring Cloud Gateway微服务网关快速入门

介绍 Spring Cloud Gateway 是 Spring 官方基于 Spring 5.0&#xff0c;Spring Boot 2.0 和 Project Reactor 等技术开发的网关&#xff0c;Spring Cloud Gateway 旨在为微服务架构提供一种简单而有效的统一的 API 路由管理方式。Spring Cloud Gateway 作为 Spring Cloud 生态…

Kamiya丨Kamiya艾美捷人乳铁蛋白ELISA说明书

Kamiya艾美捷人乳铁蛋白ELISA预期用途&#xff1a; 人乳铁蛋白ELISA是一种高度灵敏的双位点酶联免疫测定&#xff08;ELISA&#xff09;人类生物样品中乳铁蛋白的测定。仅供研究使用。不用于诊断程序。 引言 乳铁蛋白&#xff08;LF&#xff09;是一种具有抗菌活性的多功能铁…

运动“双十一”持续走热,缤跃酒店洞察市场需求,创新打造运动健康酒店!

2022年“双十一”购物促销活动刚刚结束&#xff0c;各大品牌陆续开始展示肌肉&#xff0c;在众多数据中运动健身领域相关数据不容忽视&#xff0c;居家健身器械等商品持续走热&#xff0c;户外运动设备销售量也保持热度。由此可见&#xff0c;在当下全民运动热潮下&#xff0c;…

uniapp开发微信小程序实现语音识别,使用微信同声传译插件,

第一步&#xff1a;在微信小程序管理后台&#xff1a;“设置”-》“第三方设置”-》“插件管理”中添加插件。 但是这个地方&#xff0c;没有搜索到插件&#xff0c;就到微信服务市场 搜索到以后添加到需要的小程序里面&#xff0c;然后返回管理中心查看&#xff0c;就可以看…

Css3 3D转换

特点&#xff1a; 近大远小物体后面遮挡不可见 三维坐标系&#xff1a; 三维坐标系其实就是指立体空间&#xff0c;立体空间是由3个轴共同组成的。 X轴&#xff1a;水平向右为正 Y轴&#xff1a;垂直向下为正 Z轴&#xff1a;垂直屏幕向外为正 3D位移和3D旋转&#xff1a…

曲柄压力机的离合器和制动系统设计

目 录 摘 要 I ABSTRACT II 第1章 绪论 1 1.1压力机发展的概况 1 1.2压力机工作原理 1 1.2.1压力机功能简介 1 1.2.2压力机的工作原理简介 3 1.3 压力机的分类 3 1.4 压力机的主要参数和型号 4 1.5本次设计压力机参数及内容 6 1.5.1主要技术参数 6 1.5.2设计内容 6 第二章 曲柄…

学妹居然叫我帮她P证件照自拍,结果发现.........

前因后果 事情是这样的 晚上我正在聚精会神写代码&#xff08;打游戏~&#xff09; 突然&#xff0c;收到学妹给我发来的消息 还有一张自拍照 而且是可以放在结婚证上的那种哦 原来是照片尺寸不合适 让我帮她修图。还要什么蓝底、红底各种背景的 效果 1、尺寸长宽调整为&…

有序数组转换为二叉查找树

问题描述 给定一个整数数组&#xff0c;其元素为先序排列&#xff0c;将其转换为高度平衡的二叉查找树。 示例 示例1 Input: nums [-10,-3,0,5,9] Output: [0,-3,9,-10,null,5] Explanation: [0,-10,5,null,-3,null,9] is also accepted: 示例2 Input: nums [1,3] Output: …

STM32实战总结:HAL之触摸屏

输入类设备简介 IO输入输出&#xff0c;是计算机系统中的一个概念。计算机的主要功能就是从外部获取数据然后进行计算加工得到目标数据并输出给外部&#xff08;计算机可以看成数据处理器&#xff09;。计算机和外部交互就是通过IO。每一台计算机都有个标准输入和标准输出。 常…

业务:财务会计业务知识

一、引言 会计是以货币为主要计量单位&#xff0c;对企业、事业、机关、团体及其他经济组织的经济活动进行记录、计算、控制、分析、报告&#xff0c;以提供财务和管理信息的工作。会计的职能主要是反映和控制经济活动过程&#xff0c;保证会计信息的合法、真实、准确和完整&a…

像素坐标和实际坐标的转换

文章目录像素坐标系图像坐标系小孔成像原理相机坐标系畸变参数像素坐标系 像素坐标系uov是一个二维直角坐标系&#xff0c;反映了相机CCD/CMOS芯片中像素的排列情况。原点o位于图像的左上角&#xff0c;u轴、v轴分别于像面的两边平行。像素坐标系中坐标轴的单位是像素&#xf…

新手python的自学总结(已拿到百度offer)

今天给大家分享一个小伙伴自学Python找到工作的文章。 先简单介绍一下小伙伴的情况。是非科班出身的&#xff0c;虽然高中读的是理科&#xff0c;但是进入大学学了一个文科专业&#xff0c;之后就再没接触过理工科的东西。对计算机也是一窍不通&#xff0c;大学才刚开始接触电…