gpt4 book ai didi

php - 代码接收是否正常工作?

转载 作者:行者123 更新时间:2023-11-28 20:55:12 24 4
gpt4 key购买 nike

我不得不在 codeception 中编写功能性概念。它只是创建 2 个对话并单击其中一个上的删除按钮,并检查是否删除了正确的对话。我编写了测试以查看是否一切正常,但事实并非如此。测试逻辑如下:

  1. 用户登录
  2. 用户向不同的用户发送了 2 条消息。(将创建 2 个对话)
  3. 用户点击其中一个上的“删除对话”按钮
  4. 用户检查是否删除了正确的对话。

<?php 
$I = new FunctionalTester($scenario);
$I->am('a user');
$I->wantTo('delete existing conversation');

$user = $I->signIn();

$I->sendMessage('other', 'some random message');
$I->sendMessage('AnotherUser', 'other random message');

dd($user->conversations->count());

$I->click('Delete conversation');

$I->seeCurrentUrlEquals('/inbox');
$I->dontSee('other random message');
$I->see('some random message');

但问题是用户对话的计数始终为 1。无论我向新用户发送了多少消息,dd($user->conversations->count()) 始终为 1 . 但是消息已经发送(但是要发送消息你应该创建一个对话)。我不知道这怎么可能?我写了一个集成测试来检查创建对话的功能是否正常工作。它是。我不知道如何测试应用程序的逻辑。

最佳答案

在执行 dd($user->conversations->count()); 之前你需要执行一些 waitForElementVisible 方法似乎之前的 Action 没有完全完成.

关于php - 代码接收是否正常工作?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26233548/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com