-
Notifications
You must be signed in to change notification settings - Fork 139
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
882ca04
commit 1b5a0b1
Showing
20 changed files
with
541 additions
and
183 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import scene | ||
import sqlite3 | ||
|
||
|
||
class Task: | ||
''' | ||
任务类: | ||
初始化参数: 任务名task_name, 项目project, 测试套suite | ||
''' | ||
|
||
def __init__(self, task_name, project, suite): | ||
self.name = task_name | ||
self.project = project | ||
self.suite = get_suite(suite, project) | ||
|
||
def get_suite(self, suite, project): | ||
suite_data = self.db('select data from suite where name="%s" and project="%s"' % (suite, project)) | ||
return suite_data[0][0].split(',') | ||
|
||
def run(self): | ||
|
||
set_cookie('公共-用户-用户登录', project_name) | ||
for elem in self.suite: | ||
s = Scene(elem, project_name) | ||
s.run() | ||
|
||
def db(self, cmd): | ||
s = sqlite3.connect(Interface.db_path) | ||
r = s.execute(cmd).fetchall() | ||
s.commit() | ||
s.close() | ||
return r |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
$(function(){ | ||
//选择项目后,动态加载测试套 | ||
$('select#project').change(function(){ | ||
if ($(this).val() != 'none'){ | ||
$.post('/suite', {'type': 'get_suite', 'project': $(this).val()}, function(data){ | ||
var obj = $('select#suite'); | ||
obj.empty(); | ||
var html = '<option value="none">请选择测试套</option>'; | ||
for (i=0;i<data.suite.length;i++){ | ||
html = html + '<option value="' + data.suite[i] + '">' + data.suite[i] + '</option>'; | ||
}; | ||
obj.html(html); | ||
}); | ||
} | ||
else{ | ||
$('select#suite').empty(); | ||
$('select#suite').html('<option value="none">请选择测试套</option>'); | ||
$('div#suite_data').hide(); | ||
}; | ||
}); | ||
|
||
//新建任务 | ||
$('button#new_task').on('click', function(){ | ||
if ($('select#suite').val() == 'none'){ | ||
$("h4#myModalLabel").text("提示"); | ||
$("div.modal-body").text("请先选择好测试套!"); | ||
$("button#send_alert").trigger("click"); | ||
return | ||
}; | ||
if ($('input#task_name').val() == ''){ | ||
$("h4#myModalLabel").text("提示"); | ||
$("div.modal-body").text("任务名不能为空!"); | ||
$("button#send_alert").trigger("click"); | ||
return | ||
}; | ||
$.post('/interf_task', {'type': 'new_task', 'name': $('input#task_name').val(), 'project': $('select#project').val(), 'suite': $('select#suite').val()}, function(data){ | ||
if (data.code == 200){ | ||
$("h4#myModalLabel").text("提示"); | ||
$("div.modal-body").text("任务新建成功!"); | ||
$("button#send_alert").trigger("click"); | ||
|
||
} | ||
else{ | ||
$("h4#myModalLabel").text("提示"); | ||
$("div.modal-body").text("任务新建失败!"); | ||
$("button#send_alert").trigger("click"); | ||
}; | ||
|
||
}); | ||
}); | ||
|
||
}); |
Oops, something went wrong.