如何使用参数执行黄昏测试

时间:2019-06-06 17:16:59

标签: php laravel laravel-5.7 laravel-dusk laravel-dusk2

我想用参数执行laravel黄昏测试,所以我确实尝试了这样

/*check if the #databases table is already present and then drop it*/

IF OBJECT_ID('tempdb..#databases', 'U') IS NOT NULL
begin
    drop table #databases;
end

select ArtifactID into #databases from edds.eddsdbo.[Case]
where name like '%Review%'

/*Once this first statement has been run there will now be a
number column that is associated with the artificatID. Each database has an area that is 
titled [EDDS'artifactID']. So if the artifactID = 1111111 then the DB would 
be accessed at [EDDS1111111]*/

declare @runs int = 1; /*this will track the number of times iterated 
over the result set*/

declare @max int = 0; /*this will be the limit*/

declare @databasename sysname='' /*this will allow the population of each 
database name*/

/*check if your temp table exists and drop if necessary*/
IF OBJECT_ID('tempdb..#temptable', 'U') IS NOT NULL
begin
    drop table #temptable;
end

/*create the temp table as outside the loop*/

create table #temptable(
fileSize dec,
extractedTextSize dec
)


while @runs<=@max
begin

select @max=count(*) from #databases;
/*the @max is now the number of databases inserted in to this table*/


/*This select statement pulls the information that will be placed 
into the temptable. This second statment should be inside the loop. One time 
for each DB that appeared in the first query's results.*/

/*begin the loop by assigning your database name, I don't know what the 
column is called so I have just called it databasename for now*/

select top 1 @databasename = ArtifactID from #databases;

/*generate your sql using the @databasename variable, if you want to make 
the database and table names dynamic too then you can use the same formula*/

insert into #temptable
select SUM(fileSize)/1024/1024/1024, SUM(extractedTextSize)/1024/1024
FROM [EDDS'+cast(@databasename as nvarchar(128))+'].[EDDSDBO].[Document] ed
where ed.CreatedDate >= (select CONVERT(varchar,dateadd(d,- 
(day(getdate())),getdate()),106))'


/*remove that row from the databases table so the row won't be redone
This will take the @max and lessen it by one*/
delete from #databases where ArtifactID=@databasename;

/* Once the @max is less than 1 then end the loop*/
end

/* Query the final values in the temp table after the iteration is complete*/
select filesize+extractedTextSize as Gigs from #temptable

在控制台中,但是它不起作用,并且出现语法错误

我想知道如何使用参数执行测试代码

这是不可能的??

请告诉我该怎么做.......

------以下是我的黄昏代码

php artisan dusk --filter ExampleTest::testBasicExample( here parameter );

1 个答案:

答案 0 :(得分:0)

您没有关闭功能testBasicExample。在}行之后添加大括号$this->browse(...)