Add Autotype Entry-Attributes, Fix Group default sequence (#107)

This commit is contained in:
TheZ3ro 2016-11-25 18:26:59 +01:00 committed by Jonathan White
parent 0dfd2003f9
commit 405b82588b
7 changed files with 114 additions and 49 deletions

View file

@ -90,6 +90,20 @@ void TestAutoType::init()
association.window = "//^REGEX3-([rd]\\d){2}$//";
association.sequence = "regex3";
m_entry3->autoTypeAssociations()->add(association);
m_entry4 = new Entry();
m_entry4->setGroup(m_group);
m_entry4->setPassword("custom_attr");
m_entry4->attributes()->set("CUSTOM","Attribute",false);
association.window = "//^CustomAttr1$//";
association.sequence = "{PASSWORD}:{CUSTOM}";
m_entry4->autoTypeAssociations()->add(association);
association.window = "//^CustomAttr2$//";
association.sequence = "{CuStOm}";
m_entry4->autoTypeAssociations()->add(association);
association.window = "//^CustomAttr3$//";
association.sequence = "{PaSSworD}";
m_entry4->autoTypeAssociations()->add(association);
}
void TestAutoType::cleanup()
@ -192,4 +206,22 @@ void TestAutoType::testGlobalAutoTypeRegExp()
m_autoType->performGlobalAutoType(m_dbList);
QCOMPARE(m_test->actionChars(), QString("regex3"));
m_test->clearActions();
// with custom attributes
m_test->setActiveWindowTitle("CustomAttr1");
m_autoType->performGlobalAutoType(m_dbList);
QCOMPARE(m_test->actionChars(), QString("custom_attr:Attribute"));
m_test->clearActions();
// with (non uppercase) undefined custom attributes
m_test->setActiveWindowTitle("CustomAttr2");
m_autoType->performGlobalAutoType(m_dbList);
QCOMPARE(m_test->actionChars(), QString(""));
m_test->clearActions();
// with mixedcase default attributes
m_test->setActiveWindowTitle("CustomAttr3");
m_autoType->performGlobalAutoType(m_dbList);
QCOMPARE(m_test->actionChars(), QString("custom_attr"));
m_test->clearActions();
}