def loadCfg(self):
        """
        """
        with open("%s/config.json" % (QtHelper.dirExec())) as f:
            CONFIG_RAW = f.read()
        self.config = json.loads(CONFIG_RAW)

        self.jenkinsSvrURL.setText(self.config["jenkins-server"]["url"])
예제 #2
0
    def loadCfg(self):
        """
        """
        with open("%s/config.json" % (QtHelper.dirExec())) as f:
            CONFIG_RAW = f.read()
        self.config = json.loads(CONFIG_RAW)

        self.hpCredLogin.setText(self.config["credentials"]["login"])
        self.hpSvrURL.setText(self.config["qc-server"]["url"])
        self.hpSvrDomain.setText(self.config["qc-server"]["domain"])
        self.hpSvrProject.setText(self.config["qc-server"]["project"])

        self.restAPI.setChecked(True)

        if self.config["export-tests"]["merge-all-tests"]:
            self.mergeCheckBox.setCheckState(Qt.Checked)
        if self.config["export-tests"]["merge-all-steps"]:
            self.mergeStepsCheckBox.setCheckState(Qt.Checked)
        if self.config["export-tests"]["original-test"]:
            self.showTcNameCheckBox.setCheckState(Qt.Checked)
        if self.config["export-tests"]["replace-testcase"]:
            self.replaceTcCheckBox.setCheckState(Qt.Checked)
        if self.config["export-tests"]["add-folders"]:
            self.addFoldersTpCheckBox.setCheckState(Qt.Checked)
        if self.config["export-tests"]["overwrite-tests"]:
            self.overwriteTcCheckBox.setCheckState(Qt.Checked)
        self.cfgsTable.loadTable(data=self.config["custom-test-fields"])

        if self.config["export-results"]["ignore-testcase"]:
            self.ignoreTcCheckBox.setCheckState(Qt.Checked)
        if self.config["export-results"]["ignore-uncomplete"]:
            self.ignoreUncompleteCheckBox.setCheckState(Qt.Checked)
        if self.config["export-results"]["add-folders"]:
            self.addFoldersTlCheckBox.setCheckState(Qt.Checked)
        if self.config["export-results"]["add-testset"]:
            self.addTestsetCheckBox.setCheckState(Qt.Checked)
        if self.config["export-results"]["add-testinstance"]:
            self.addTestinstanceCheckBox.setCheckState(Qt.Checked)
        self.cfgsTestsetTable.loadTable(
            data=self.config["custom-testset-fields"])

        # decrypt password
        if len(self.config["credentials"]["password"]):
            decrypted = self.decryptPwd(
                key=bytes(self.config["credentials"]["login"], "utf8"),
                ciphertext=bytes(self.config["credentials"]["password"],
                                 "utf8"))
            self.config["credentials"]["password"] = decrypted
            self.hpCredPwd.setText(decrypted)
    def saveCfg(self):
        """
        """
        if not len(self.jenkinsSvrURL.text()):
            QMessageBox.warning(self, self.tr("Save Settings"),
                                self.tr("Please to set the server url"))
            return

        self.config["jenkins-server"]["url"] = self.jenkinsSvrURL.text()

        with open("%s/config.json" % (QtHelper.dirExec()), "w") as f:
            f.write(json.dumps(self.config))

        self.ReloadSettings.emit()

        QMessageBox.information(self, self.tr("Save Settings"),
                                self.tr("Settings saved."))
예제 #4
0
    def setData(self, index, value, role=Qt.EditRole):
        """
        Cell content change

        @param index: 
        @type index:

        @param value: 
        @type value:

        @param role: 
        @type role:

        @return:
        @rtype:
        """
        if not index.isValid(): return False
        value = QtHelper.displayToValue( value )
        self.setValue(index, value)
        return True
예제 #5
0
    def saveCfg(self, successMsg=True):
        """
        """
        # if successMsg:
        if not len(self.hpSvrURL.text()):
            QMessageBox.warning(self, self.tr("Save Settings") , self.tr("Please to set the server url") )
            return
        if not len(self.hpSvrDomain.text()):
            QMessageBox.warning(self, self.tr("Save Settings") , self.tr("Please to set the server domain") )
            return
        if not len(self.hpSvrProject.text()):
            QMessageBox.warning(self, self.tr("Save Settings") , self.tr("Please to set the server project") )
            return

        if not len(self.hpCredLogin.text()):
            QMessageBox.warning(self, self.tr("Save Settings") , self.tr("Please to set a login") )
            return
        if not len(self.hpCredPwd.text()):
            QMessageBox.warning(self, self.tr("Save Settings") , self.tr("Please to set a password") )
            return
            
        self.config["credentials"]["login"] = self.hpCredLogin.text()
        # encrypt password
        encryptPwd = self.encryptPwd(
                                    key=self.hpCredLogin.text(),
                                    plaintext=self.hpCredPwd.text()
                                   )
        self.config["credentials"]["password"] = str(encryptPwd, "utf8")
        
        self.config["qc-server"]["url"] = self.hpSvrURL.text()
        self.config["qc-server"]["domain"] = self.hpSvrDomain.text()
        self.config["qc-server"]["project"] = self.hpSvrProject.text()
        self.config["qc-server"]["use-rest"] = False
        if self.restAPI.isChecked(): self.config["qc-server"]["use-rest"] = True
        
        self.config["export-tests"]["merge-all-tests"] = False
        self.config["export-tests"]["merge-all-steps"] = False
        self.config["export-tests"]["original-test"] = False
        self.config["export-tests"]["replace-testcase"] = False
        self.config["export-tests"]["add-folders"] = False
        self.config["export-tests"]["overwrite-tests"] = False
        if self.mergeCheckBox.isChecked(): self.config["export-tests"]["merge-all-tests"] = True
        if self.mergeStepsCheckBox.isChecked(): self.config["export-tests"]["merge-all-steps"] = True
        if self.showTcNameCheckBox.isChecked(): self.config["export-tests"]["original-test"] = True
        if self.replaceTcCheckBox.isChecked(): self.config["export-tests"]["replace-testcase"] = True
        if self.addFoldersTpCheckBox.isChecked(): self.config["export-tests"]["add-folders"] = True
        if self.overwriteTcCheckBox.isChecked(): self.config["export-tests"]["overwrite-tests"] = True
        self.config["custom-test-fields"] = self.cfgsTable.model.getData()
        
        self.config["export-results"]["add-folders"] = False
        self.config["export-results"]["ignore-testcase"] = False
        self.config["export-results"]["ignore-uncomplete"] = False
        self.config["export-results"]["add-testset"] = False
        self.config["export-results"]["add-testinstance"] = False
        if self.ignoreTcCheckBox.isChecked(): self.config["export-results"]["ignore-testcase"] = True
        if self.ignoreUncompleteCheckBox.isChecked(): self.config["export-results"]["ignore-uncomplete"] = True
        if self.addFoldersTlCheckBox.isChecked(): self.config["export-results"]["add-folders"] = True
        if self.addTestsetCheckBox.isChecked(): self.config["export-results"]["add-testset"] = True
        if self.addTestinstanceCheckBox.isChecked(): self.config["export-results"]["add-testinstance"] = True
        self.config["custom-testset-fields"] = self.cfgsTestsetTable.model.getData()
        
        with open( "%s/config.json" % (QtHelper.dirExec()), "w" ) as f:
            f.write( json.dumps(self.config) )
            
        if len(self.config["credentials"]["password"]):
            self.config["credentials"]["password"] = self.decryptPwd(
                                            key=bytes(self.config["credentials"]["login"], "utf8" ),
                                            ciphertext=bytes(self.config["credentials"]["password"], "utf8" )
                                  )
                
        self.ReloadSettings.emit()
        
        if successMsg: QMessageBox.information(self, self.tr("Save Settings") ,  self.tr("Settings saved.") )
예제 #6
0
import DesignPage
import VerdictPage

import sys
import json
import threading
import sip
# from Crypto.Cipher import XOR
import base64

import copy

import os

# adding missing folders
if not os.path.exists( "%s/Core/Logs/" % QtHelper.dirExec() ):
    os.mkdir( "%s/Core/Logs" % QtHelper.dirExec() )

    
LICENSE = """<br />
&nbsp;&nbsp;%s plugin <b>%s</b> for the <b>%s</b><br />
&nbsp;&nbsp;Developed and maintained by <b>Denis Machard</b><br />
&nbsp;&nbsp;Contributors: <b>%s</b><br />
&nbsp;&nbsp;<br />
&nbsp;&nbsp;This program is free software; you can redistribute it and/or<br />
&nbsp;&nbsp;modify it under the terms of the GNU Lesser General Public<br />
&nbsp;&nbsp;License as published by the Free Software Foundation; either<br />
&nbsp;&nbsp;version 2.1 of the License, or (at your option) any later version.<br />
&nbsp;&nbsp;<br />
&nbsp;&nbsp;This library is distributed in the hope that it will be useful,<br />
&nbsp;&nbsp;but WITHOUT ANY WARRANTY; without even the implied warranty of<br />
예제 #7
0
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301 USA
#
# Gfi Informatique, Inc., hereby disclaims all copyright interest in the
# extensive testing project written by Denis Machard
#
# Author: Denis Machard
# Contact: [email protected]
# Website: www.extensivetesting.org
# -------------------------------------------------------------------

from Core import ConfigureExe
from Core import BuildWin
from Core.Libs import QtHelper, Logger

import json

# read the config
CONFIG = None
with open("%s/config.json" % (QtHelper.dirExec())) as f:
    CONFIG_RAW = f.read()
CONFIG = json.loads(CONFIG_RAW)

# start the compilation
ConfigureExe.run()
BuildWin.run(pluginName=CONFIG["plugin"]["name"],
             pluginVersion=CONFIG["plugin"]["version"])
 def loadCfg(self):
     """
     """
     with open("%s/config.json" % (QtHelper.dirExec())) as f:
         CONFIG_RAW = f.read()
     self.config = json.loads(CONFIG_RAW)
    from PyQt5.QtCore import (QFile, Qt, QIODevice, pyqtSignal,
                              QAbstractTableModel, QModelIndex)

from Core import CorePlugin
from Core import Settings
from Core.Libs import QtHelper, Logger

import SeleniumParser

import sys
import json
import sip
import os

# adding missing folders
if not os.path.exists("%s/Core/Logs/" % QtHelper.dirExec()):
    os.mkdir("%s/Core/Logs" % QtHelper.dirExec())

LICENSE = """<br />
%s plugin <b>%s</b> for the <b>%s</b><br />
Developed and maintained by <b>Denis Machard</b><br />
Contributors: <b>%s</b><br />
<br />
This program is free software; you can redistribute it and/or<br />
modify it under the terms of the GNU Lesser General Public<br />
License as published by the Free Software Foundation; either<br />
version 2.1 of the License, or (at your option) any later version.<br />
<br />
This library is distributed in the hope that it will be useful,<br />
but WITHOUT ANY WARRANTY; without even the implied warranty of<br />
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU<br />